diff --git a/src/nvim.rs b/src/nvim.rs index 99a4feb..39d97e0 100644 --- a/src/nvim.rs +++ b/src/nvim.rs @@ -67,7 +67,6 @@ macro_rules! try_uint { pub fn initialize(ui: &mut Ui, nvim_bin_path: Option<&String>) -> Result<()> { let session = if let Some(path) = nvim_bin_path { - println!("{}", path); Session::new_child_path(path)? } else { Session::new_child()? @@ -193,14 +192,13 @@ fn safe_call(cb: F) } pub trait ErrorReport { - fn report_err(&self, nvim: &mut NeovimApi, ctx_msg: &str); + fn report_err(&self, nvim: &mut NeovimApi); } impl ErrorReport for result::Result { - fn report_err(&self, _: &mut NeovimApi, ctx_msg: &str) { + fn report_err(&self, _: &mut NeovimApi) { if let &Err(ref msg) = self { - let err_msg = format!("{} {}", ctx_msg, msg); - println!("{}", err_msg); + println!("{}", msg); //nvim.report_error(&err_msg).expect("Error report error :)"); } } diff --git a/src/ui.rs b/src/ui.rs index 8a0fb4d..9114d3f 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -204,7 +204,7 @@ fn edit_paste() { }; let mut nvim = ui.nvim(); - nvim.input(paste_command).report_err(nvim, "Error paste from clipboard"); + nvim.input(paste_command).report_err(nvim); }); } @@ -213,7 +213,7 @@ fn edit_save_all() { let mut ui = ui_cell.borrow_mut(); let mut nvim = ui.nvim(); - nvim.command(":wa").report_err(nvim, "Error save all files"); + nvim.command(":wa").report_err(nvim); }); }