From 7f88381eb02f96023c58838b272f018f0f525d33 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Sun, 28 Dec 2025 20:55:14 +0100 Subject: [PATCH] refactor: prefer Selection.is_reversed to Cursor.right_of --- src/tui/editor.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 9d3a5b0..8117c67 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -2652,7 +2652,7 @@ pub const Editor = struct { switch (self.selection_mode) { .char => {}, .word => { - if (sel.begin.right_of(sel.end)) { + if (sel.is_reversed()) { sel.begin = initial.end; with_selection_const(root, move_cursor_word_begin, primary, self.metrics) catch {}; } else { @@ -2661,7 +2661,7 @@ pub const Editor = struct { } }, .line => { - if (sel.begin.right_of(sel.end)) { + if (sel.is_reversed()) { sel.begin = initial.end; with_selection_const(root, move_cursor_begin, primary, self.metrics) catch {}; } else {