@@ -1290,7 +1290,7 @@ pub fn completion(cx: &mut Context) {
12901290
12911291 // TODO: if no completion, show some message or something
12921292 if !res.is_empty() {
1293− let snapshot = doc.state.clone();
1293+ // let snapshot = doc.state.clone();
12941294 let mut menu = ui::Menu::new(
12951295 res,
12961296 |item| {
@@ -1304,13 +1304,13 @@ pub fn completion(cx: &mut Context) {
13041304 PromptEvent::Abort => {
13051305 // revert state
13061306 let doc = &mut editor.view_mut().doc;
1307− doc.state = snapshot.clone();
1307+ // doc.state = snapshot.clone();
13081308 }
13091309 PromptEvent::Validate => {
13101310 let doc = &mut editor.view_mut().doc;
13111311
13121312 // revert state to what it was before the last update
1313− doc.state = snapshot.clone();
1313+ // doc.state = snapshot.clone();
13141314
13151315 // extract as fn(doc, item):
13161316
@@ -1350,6 +1350,7 @@ pub fn completion(cx: &mut Context) {
13501350 }
13511351 }
13521352
1353+ // TODO: <-- if state has changed by further input, transaction will panic on len
13531354 let transaction =
13541355 util::generate_transaction_from_edits(&doc.state, vec![edit]);
13551356 doc.apply(&transaction);