@@ -34,8 +34,8 @@ pub fn regex_prompt(
3434 fun: impl Fn(&mut View, &mut Document, Regex, PromptEvent) + 'static,
3535) -> Prompt {
3636 let (view, doc) = current!(cx.editor);
37− let view_id = view.id;
38− let snapshot = doc.selection(view_id).clone();
37+ let doc_id = view.doc;
38+ let snapshot = doc.selection(view.id).clone();
3939 let offset_snapshot = view.offset;
4040
4141 let mut prompt = Prompt::new(
@@ -49,17 +49,16 @@ pub fn regex_prompt(
4949 doc.set_selection(view.id, snapshot.clone());
5050 view.offset = offset_snapshot;
5151 }
52− PromptEvent::Validate => {
53− // TODO: push_jump to store selection just before jump
54−
55− match Regex::new(input) {
56− Ok(regex) => {
57− let (view, doc) = current!(cx.editor);
58− fun(view, doc, regex, event);
59− }
60− Err(_err) => (), // TODO: mark command line as error
52+ PromptEvent::Validate => match Regex::new(input) {
53+ Ok(regex) => {
54+ let (view, doc) = current!(cx.editor);
55+ // Equivalent to push_jump to store selection just before jump
56+ view.jumps.push((doc_id, snapshot.clone()));
57+ fun(view, doc, regex, event);
6158 }
62− }
59+ Err(_err) => (), // TODO: mark command line as error
60+ },
61+
6362 PromptEvent::Update => {
6463 // skip empty input, TODO: trigger default
6564 if input.is_empty() {