aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-29 06:21:48 +0000
committerBlaž Hrastnik2021-03-29 06:21:48 +0000
commit5c2d2fda213164fe2cba005f28cee263486587ed (patch)
tree5f064949d7ff87c00580a8f20707811d52c8c70b /helix-term/src/commands.rs
parentaefafc25cd235183261efa2d59265855e0e992e1 (diff)
Wire up opening in splits via pickers.
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index e1a03ee1..0745c624 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -864,7 +864,7 @@ pub fn buffer_picker(cx: &mut Context) {
None => "[NEW]".into(),
}
},
- |editor: &mut Editor, (_, path): &(DocumentId, Option<PathBuf>)| match path {
+ |editor: &mut Editor, (_, path): &(DocumentId, Option<PathBuf>), _action| match path {
Some(path) => {
use helix_view::editor::Action;
editor
@@ -1082,10 +1082,10 @@ fn _goto(cx: &mut Context, locations: Vec<lsp::Location>) {
let line = item.range.start.line;
format!("{}:{}", file, line).into()
},
- move |editor: &mut Editor, item| {
- editor.open(PathBuf::from(item.uri.path()), Action::Replace);
- // TODO: issues with doc already being broo
- let id = editor.view().doc;
+ move |editor: &mut Editor, item, action| {
+ let id = editor
+ .open(PathBuf::from(item.uri.path()), action)
+ .expect("editor.open failed");
let doc = &mut editor.documents[id];
let definition_pos = item.range.start;
let new_pos = helix_lsp::util::lsp_pos_to_pos(doc.text(), definition_pos);