create savepoint before requesting completion

pull/6242/head
Pascal Kuthe 2 years ago committed by Blaž Hrastnik
parent bc23e54805
commit 4300a3ad05

@ -4181,6 +4181,7 @@ pub fn completion(cx: &mut Context) {
iter.reverse(); iter.reverse();
let offset = iter.take_while(|ch| chars::char_is_word(*ch)).count(); let offset = iter.take_while(|ch| chars::char_is_word(*ch)).count();
let start_offset = cursor.saturating_sub(offset); let start_offset = cursor.saturating_sub(offset);
doc.savepoint();
cx.callback( cx.callback(
future, future,

@ -957,9 +957,6 @@ impl EditorView {
return; return;
} }
// Immediately initialize a savepoint
doc_mut!(editor).savepoint();
editor.last_completion = None; editor.last_completion = None;
self.last_insert.1.push(InsertEvent::TriggerCompletion); self.last_insert.1.push(InsertEvent::TriggerCompletion);

Loading…
Cancel
Save