From 2f82bc13e87ded654f933d1751063da889bac7c7 Mon Sep 17 00:00:00 2001 From: EsfoNL <59415349+EsfoNL@users.noreply.github.com> Date: Wed, 12 Apr 2023 00:59:08 +0200 Subject: [PATCH] Fix crash on opening jumplist (#6672) Co-authored-by: Esra Fokker --- helix-term/src/commands.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 17669924c..95310c1fe 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2547,6 +2547,13 @@ fn jumplist_picker(cx: &mut Context) { } } + for (view, _) in cx.editor.tree.views_mut() { + for doc_id in view.jumps.iter().map(|e| e.0).collect::>().iter() { + let doc = doc_mut!(cx.editor, doc_id); + view.sync_changes(doc); + } + } + let new_meta = |view: &View, doc_id: DocumentId, selection: Selection| { let doc = &cx.editor.documents.get(&doc_id); let text = doc.map_or("".into(), |d| {