refactor: prefer Selection.is_reversed to Cursor.right_of
This commit is contained in:
parent
182011059d
commit
7f88381eb0
1 changed files with 2 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue