create savepoint before requesting completion
commit4300a3ad058ea383a59a0a90f31a597eb264a7d4
authorPascal Kuthe <pascal.kuthe@semimod.de>
dateThu 2 Mar 2023, 19:08 (4 years ago)
parentbc23e54
helix-term/src/commands.rs+1
@@ -4181,6 +4181,7 @@ pub fn completion(cx: &mut Context) {
41814181 iter.reverse();
41824182 let offset = iter.take_while(|ch| chars::char_is_word(*ch)).count();
41834183 let start_offset = cursor.saturating_sub(offset);
4184+ doc.savepoint();
41844185
41854186 cx.callback(
41864187 future,
helix-term/src/ui/editor.rs−3
@@ -957,9 +957,6 @@ impl EditorView {
957957 return;
958958 }
959959
960− // Immediately initialize a savepoint
961− doc_mut!(editor).savepoint();
962−
963960 editor.last_completion = None;
964961 self.last_insert.1.push(InsertEvent::TriggerCompletion);
965962