mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04: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 @@ fn command_mode(&mut self, mode: Mode, cxt: &mut commands::Context, event: KeyEv
|
||||
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