mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-09 13:31:34 +03:00
Fix underflow when repeating a completion that has a negative shift position (#7322)
This commit is contained in:
parent
25ad534d64
commit
2a11fb485d
@ -907,8 +907,9 @@ impl EditorView {
|
||||
let text = doc.text().slice(..);
|
||||
let cursor = doc.selection(view.id).primary().cursor(text);
|
||||
|
||||
let shift_position =
|
||||
|pos: usize| -> usize { pos + cursor - trigger_offset };
|
||||
let shift_position = |pos: usize| -> usize {
|
||||
(pos + cursor).saturating_sub(trigger_offset)
|
||||
};
|
||||
|
||||
let tx = Transaction::change(
|
||||
doc.text(),
|
||||
|
Loading…
Reference in New Issue
Block a user