aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-05-07 05:40:11 +0000
committerBlaž Hrastnik2021-05-07 05:45:49 +0000
commitc20813690f962856efa1989576d9f7c91364f265 (patch)
tree12291c3defd478536806c369e3520e30b5631018 /helix-term
parentf2c79e245bdcc70be3c51fdca35917a929615152 (diff)
View::new is infallible, so is editor.switch/new_file.
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/application.rs2
-rw-r--r--helix-term/src/commands.rs4
2 files changed, 2 insertions, 4 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 9838998a..ae7e22bd 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -52,7 +52,7 @@ impl Application {
editor.open(file, Action::VerticalSplit)?;
}
} else {
- editor.new_file(Action::VerticalSplit)?;
+ editor.new_file(Action::VerticalSplit);
}
compositor.push(Box::new(ui::EditorView::new()));
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 5c1021e1..addd7437 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -935,9 +935,7 @@ pub fn buffer_picker(cx: &mut Context) {
},
|editor: &mut Editor, (id, _path): &(DocumentId, Option<PathBuf>), _action| {
use helix_view::editor::Action;
- editor
- .switch(*id, Action::Replace)
- .expect("editor.open failed");
+ editor.switch(*id, Action::Replace);
},
);
cx.push_layer(Box::new(picker));