diff options
author | Waleed Dahshan | 2024-01-29 21:58:33 +0000 |
---|---|---|
committer | GitHub | 2024-01-29 21:58:33 +0000 |
commit | cf4492174d0ee27bd3c73a5fa57fe3a26aa064be (patch) | |
tree | 83dd4520404738808e0185f33feb23bf2c7a830c /helix-term | |
parent | 87a720c3a13ccc7245f5b0befc008db5bd039032 (diff) |
Use range positions to determine insert_newline motion (#9448)
* use anchor and head positions to determine motion
* use range cursor to decide extending or shifting
* add condition to cursor moving back on normal
Diffstat (limited to 'helix-term')
-rw-r--r-- | helix-term/src/commands.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 4df3278b..d44f477b 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3651,7 +3651,7 @@ pub mod insert { (pos, pos, local_offs) }; - let new_range = if doc.restore_cursor { + let new_range = if range.cursor(text) > range.anchor { // when appending, extend the range by local_offs Range::new( range.anchor + global_offs, |