Skip to content

Commit

Permalink
use range cursor to decide extending or shifting
Browse files Browse the repository at this point in the history
  • Loading branch information
wmstack committed Jan 27, 2024
1 parent 84a0117 commit 8703ad4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3650,7 +3650,8 @@ pub mod insert {

(pos, pos, local_offs)
};
let new_range = if range.head > range.anchor {

let new_range = if range.cursor(text) > range.anchor {
// when appending, extend the range by local_offs
Range::new(
range.anchor + global_offs,
Expand Down

0 comments on commit 8703ad4

Please sign in to comment.