summaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorSkyler Hawthorne2022-04-26 23:18:20 +0000
committerSkyler Hawthorne2022-06-19 03:57:45 +0000
commited950fcc56c480dc5a54c7e07918dca9192db200 (patch)
tree453e6f56c72d8c29fe9b1e39361a13d19c9722b1 /helix-term/src/commands.rs
parent1533f489340fb63eee31c12122d6233cb5f6abaf (diff)
Add more context; Editor::open doesn't need to own path
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 6b01cbe3..85dbfd56 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1024,7 +1024,7 @@ fn goto_file_impl(cx: &mut Context, action: Action) {
for sel in paths {
let p = sel.trim();
if !p.is_empty() {
- if let Err(e) = cx.editor.open(PathBuf::from(p), action) {
+ if let Err(e) = cx.editor.open(&PathBuf::from(p), action) {
cx.editor.set_error(format!("Open file failed: {:?}", e));
}
}
@@ -1849,7 +1849,7 @@ fn global_search(cx: &mut Context) {
}
},
move |cx, (line_num, path), action| {
- match cx.editor.open(path.into(), action) {
+ match cx.editor.open(path, action) {
Ok(_) => {}
Err(e) => {
cx.editor.set_error(format!(