aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-24 05:28:26 +0000
committerBlaž Hrastnik2021-03-24 05:28:26 +0000
commit8a0ab447ecfa6c2c448603d469ba4fd06e95c754 (patch)
tree9bf78106dbc54d02f7938d287467da44feaffe9d /helix-term/src/ui
parentb24cdd1295d1129dc730e02da2c6723938220d7e (diff)
editor.open can now either replace the current view or open in a split.
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs
index f91a9f35..a625aa14 100644
--- a/helix-term/src/ui/mod.rs
+++ b/helix-term/src/ui/mod.rs
@@ -101,7 +101,10 @@ pub fn file_picker(root: &str) -> Picker<PathBuf> {
path.strip_prefix("./").unwrap().to_str().unwrap().into()
},
move |editor: &mut Editor, path: &PathBuf| {
- let document_id = editor.open(path.into()).expect("editor.open failed");
+ use helix_view::editor::Action;
+ let document_id = editor
+ .open(path.into(), Action::Replace)
+ .expect("editor.open failed");
},
)
}