Use nvim.command_async where possible

This commit is contained in:
Christopher Lübbemeier
2018-03-18 18:45:06 +01:00
parent 6ed33aa786
commit a145256182
5 changed files with 38 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
use std::rc::Rc;
use neovim_lib::NeovimApi;
use neovim_lib::{NeovimApi, NeovimApiAsync};
use nvim::{NeovimClient, ErrorReport, NeovimRef};
use value::ValueMapExt;
@@ -84,7 +84,9 @@ impl Manager {
pub fn reload(&self, path: &str) {
if let Some(mut nvim) = self.nvim() {
nvim.command(&format!("source {}", path)).report_err();
nvim.command_async(&format!("source {}", path))
.cb(|r| r.report_err())
.call()
}
}
}