diff --git a/Cargo.lock b/Cargo.lock index d200cc275..82638313d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -391,7 +391,7 @@ dependencies = [ [[package]] name = "helix-dap" -version = "0.4.1" +version = "0.5.0" dependencies = [ "anyhow", "fern", diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs index 23bb3babc..47e1b39ff 100644 --- a/helix-term/src/commands/dap.rs +++ b/helix-term/src/commands/dap.rs @@ -321,7 +321,7 @@ pub fn dap_launch(cx: &mut Context) { cx.push_layer(Box::new(Picker::new( true, - config.templates.clone(), + config.templates, |template| template.name.as_str().into(), |editor, template, _action| { let completions = template.completion.clone(); @@ -560,7 +560,6 @@ pub fn dap_enable_exceptions(cx: &mut Context) { ) { cx.editor .set_error(format!("Failed to set up exception breakpoints: {:?}", e)); - return; } } @@ -573,7 +572,6 @@ pub fn dap_disable_exceptions(cx: &mut Context) { if let Err(e) = block_on(debugger.set_exception_breakpoints(vec![])) { cx.editor .set_error(format!("Failed to set up exception breakpoints: {:?}", e)); - return; } } diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 706cf8bb5..054bb2c2a 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -1085,7 +1085,7 @@ impl EditorView { if let Some((line, _, view_id)) = result { editor.tree.focus = view_id; - let doc = &mut editor.documents[editor.tree.get(view_id).doc]; + let doc = editor.documents.get_mut(&editor.tree.get(view_id).doc).unwrap(); if let Ok(pos) = doc.text().try_line_to_char(line) { doc.set_selection(view_id, Selection::point(pos)); commands::dap_toggle_breakpoint(cxt); @@ -1184,7 +1184,7 @@ impl EditorView { if let Some((line, _, view_id)) = result { cxt.editor.tree.focus = view_id; - let doc = &mut cxt.editor.documents[cxt.editor.tree.get(view_id).doc]; + let doc = cxt.editor.documents.get_mut(&cxt.editor.tree.get(view_id).doc).unwrap(); if let Ok(pos) = doc.text().try_line_to_char(line) { doc.set_selection(view_id, Selection::point(pos)); if modifiers == crossterm::event::KeyModifiers::ALT {