fix: error that caused usize to overflow (#3024)
* fix: error that caused usize to overflow * update: changed check_sub to saturating_sub
This commit is contained in:
parent
718c3baebe
commit
e109022bfd
@ -1414,7 +1414,7 @@ fn copy_selection_on_line(cx: &mut Context, direction: Direction) {
|
||||
let (head, anchor) = if range.anchor < range.head {
|
||||
(range.head - 1, range.anchor)
|
||||
} else {
|
||||
(range.head, range.anchor - 1)
|
||||
(range.head, range.anchor.saturating_sub(1))
|
||||
};
|
||||
|
||||
let tab_width = doc.tab_width();
|
||||
|
Loading…
Reference in New Issue
Block a user