diff options
Diffstat (limited to 'src/Text.zig')
| -rw-r--r-- | src/Text.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Text.zig b/src/Text.zig index 56ee199b..411c2ec8 100644 --- a/src/Text.zig +++ b/src/Text.zig @@ -328,6 +328,15 @@ pub fn multiSelAction(t: *Text, text: []const u8, kind: modal.Normal.Multi, cnt: } return setRanges(t, text, out[0..m], &.{}, pri, expl); } + if (kind == .ensure_forward) { + // helix ensure_selections_forward: every range points forward + for (rs[0..n]) |*r| { + const from = @min(r.anchor, r.head); + r.head = @max(r.anchor, r.head); + r.anchor = from; + } + return setRanges(t, text, rs[0..n], &.{}, got.pri, expl); + } if (kind == .split_newline) { // helix selection::split_on_newline — one range per line the // selection covers, the newlines themselves left out |
