mirror of https://github.com/helix-editor/helix
Merge pull request #29 from piotrkwarcinski/exp-picker-fix
Fix call to exp-picker callbackpull/8675/merge^2
commit
c5bd4518e1
|
@ -3985,14 +3985,17 @@ fn configure_engine_impl(mut engine: Engine) -> Engine {
|
|||
let rooted = callback_fn.as_rooted();
|
||||
|
||||
let picker = ui::Picker::new(columns, 0, [], cwd, move |cx, path: &PathBuf, action| {
|
||||
if let Err(e) = cx.editor.open(path, action) {
|
||||
let result = cx.editor.open(path, action);
|
||||
match result {
|
||||
Err(e) => {
|
||||
let err = if let Some(err) = e.source() {
|
||||
format!("{}", err)
|
||||
} else {
|
||||
format!("unable to open \"{}\"", path.display())
|
||||
};
|
||||
cx.editor.set_error(err);
|
||||
|
||||
}
|
||||
Ok(_) => {
|
||||
let mut ctx = Context {
|
||||
register: None,
|
||||
count: None,
|
||||
|
@ -4017,6 +4020,7 @@ fn configure_engine_impl(mut engine: Engine) -> Engine {
|
|||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
.with_preview(|_editor, path| Some((PathOrId::Path(path), None)));
|
||||
|
||||
|
|
Loading…
Reference in New Issue