aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/lsp.rs6
-rw-r--r--helix-term/src/commands/typed.rs12
2 files changed, 9 insertions, 9 deletions
diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs
index b6bea8d6..ff61ee63 100644
--- a/helix-term/src/commands/lsp.rs
+++ b/helix-term/src/commands/lsp.rs
@@ -61,7 +61,7 @@ fn jump_to_location(
return;
}
};
- let _id = editor.open(path, action).expect("editor.open failed");
+ let _id = editor.open(&path, action).expect("editor.open failed");
let (view, doc) = current!(editor);
let definition_pos = location.range.start;
// TODO: convert inside server
@@ -114,7 +114,7 @@ fn sym_picker(
return;
}
};
- if let Err(err) = cx.editor.open(path, action) {
+ if let Err(err) = cx.editor.open(&path, action) {
let err = format!("failed to open document: {}: {}", uri, err);
log::error!("{}", err);
cx.editor.set_error(err);
@@ -385,7 +385,7 @@ pub fn apply_workspace_edit(
};
let current_view_id = view!(editor).id;
- let doc_id = match editor.open(path, Action::Load) {
+ let doc_id = match editor.open(&path, Action::Load) {
Ok(doc_id) => doc_id,
Err(err) => {
let err = format!("failed to open document: {}: {}", uri, err);
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index ae3e63af..3c88b0ce 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -50,7 +50,7 @@ fn open(
ensure!(!args.is_empty(), "wrong argument count");
for arg in args {
let (path, pos) = args::parse_file(arg);
- let _ = cx.editor.open(path, Action::Replace)?;
+ let _ = cx.editor.open(&path, Action::Replace)?;
let (view, doc) = current!(cx.editor);
let pos = Selection::point(pos_at_coords(doc.text().slice(..), pos, true));
doc.set_selection(view.id, pos);
@@ -819,7 +819,7 @@ fn vsplit(
} else {
for arg in args {
cx.editor
- .open(PathBuf::from(arg.as_ref()), Action::VerticalSplit)?;
+ .open(&PathBuf::from(arg.as_ref()), Action::VerticalSplit)?;
}
}
@@ -838,7 +838,7 @@ fn hsplit(
} else {
for arg in args {
cx.editor
- .open(PathBuf::from(arg.as_ref()), Action::HorizontalSplit)?;
+ .open(&PathBuf::from(arg.as_ref()), Action::HorizontalSplit)?;
}
}
@@ -923,7 +923,7 @@ fn tutor(
_event: PromptEvent,
) -> anyhow::Result<()> {
let path = helix_loader::runtime_dir().join("tutor.txt");
- cx.editor.open(path, Action::Replace)?;
+ cx.editor.open(&path, Action::Replace)?;
// Unset path to prevent accidentally saving to the original tutor file.
doc_mut!(cx.editor).set_path(None)?;
Ok(())
@@ -1150,7 +1150,7 @@ fn open_config(
_event: PromptEvent,
) -> anyhow::Result<()> {
cx.editor
- .open(helix_loader::config_file(), Action::Replace)?;
+ .open(&helix_loader::config_file(), Action::Replace)?;
Ok(())
}
@@ -1159,7 +1159,7 @@ fn open_log(
_args: &[Cow<str>],
_event: PromptEvent,
) -> anyhow::Result<()> {
- cx.editor.open(helix_loader::log_file(), Action::Replace)?;
+ cx.editor.open(&helix_loader::log_file(), Action::Replace)?;
Ok(())
}