From cf4492174d0ee27bd3c73a5fa57fe3a26aa064be Mon Sep 17 00:00:00 2001 From: Waleed Dahshan Date: Tue, 30 Jan 2024 08:58:33 +1100 Subject: 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--- helix-term/src/commands.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'helix-term') 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, -- cgit v1.2.3-70-g09d2