Changes due to api update of neovim-lib
This commit is contained in:
parent
c72eb65ebf
commit
df3b54b8a4
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -10,7 +10,7 @@ dependencies = [
|
||||
"glib-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gtk 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gtk-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"neovim-lib 0.2.0 (git+https://github.com/daa84/neovim-lib)",
|
||||
"neovim-lib 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pango 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pangocairo 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -236,7 +236,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
[[package]]
|
||||
name = "neovim-lib"
|
||||
version = "0.2.0"
|
||||
source = "git+https://github.com/daa84/neovim-lib#2807c85972a24bb36ed23a0c3d50d7b4a76d11a4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rmp 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -380,7 +380,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
"checksum gtk-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7445eb281879ac472e5f5816058d53eaceff2bab7b78a095a4044f4c0cccc754"
|
||||
"checksum libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)" = "88ee81885f9f04bff991e306fea7c1c60a5f0f9e409e99f6b40e3311a3363135"
|
||||
"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054"
|
||||
"checksum neovim-lib 0.2.0 (git+https://github.com/daa84/neovim-lib)" = "<none>"
|
||||
"checksum neovim-lib 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8eb0ce042e5a820f9b832fab374f9cdebf99ed805cee89cf70a1303ceefa5eb2"
|
||||
"checksum num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "e1cbfa3781f3fe73dc05321bed52a06d2d491eaa764c52335cf4399f046ece99"
|
||||
"checksum pango 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "21d777a87f13107b96be840dec1c34e0fe1a7b5630dd90c74b4eec923c439187"
|
||||
"checksum pango-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f29f64bc081e778cb897e3ef20aae178150d165d0eb77065b9e20437407c5546"
|
||||
|
@ -12,12 +12,12 @@ glib = "0.1"
|
||||
glib-sys = "0.3"
|
||||
gdk = "0.5"
|
||||
gdk-sys = "0.3"
|
||||
#neovim-lib = "^0.1.1"
|
||||
neovim-lib = "0.2"
|
||||
phf = "0.7"
|
||||
gio = "0.1"
|
||||
|
||||
[dependencies.neovim-lib]
|
||||
git = "https://github.com/daa84/neovim-lib"
|
||||
#[dependencies.neovim-lib]
|
||||
#git = "https://github.com/daa84/neovim-lib"
|
||||
|
||||
[build-dependencies]
|
||||
phf_codegen = "0.7"
|
||||
|
10
src/nvim.rs
10
src/nvim.rs
@ -1,4 +1,4 @@
|
||||
use neovim_lib::{Neovim, NeovimApi, Session, Value, Integer};
|
||||
use neovim_lib::{Neovim, NeovimApi, Session, Value, Integer, UiAttachOptions, CallError};
|
||||
use std::io::{Result, Error, ErrorKind};
|
||||
use std::result;
|
||||
use ui_model::UiModel;
|
||||
@ -78,7 +78,7 @@ pub fn initialize(ui: &mut Ui, nvim_bin_path: Option<&String>) -> Result<()> {
|
||||
let mut nvim = ui.nvim();
|
||||
|
||||
nvim.session.start_event_loop_cb(move |m, p| nvim_cb(m, p));
|
||||
nvim.ui_attach(80, 24, true).map_err(|e| Error::new(ErrorKind::Other, e))?;
|
||||
nvim.ui_attach(80, 24, UiAttachOptions::new()).map_err(|e| Error::new(ErrorKind::Other, e))?;
|
||||
nvim.command("runtime! ginit.vim").map_err(|e| Error::new(ErrorKind::Other, e))?;
|
||||
|
||||
Ok(())
|
||||
@ -188,10 +188,10 @@ pub trait ErrorReport {
|
||||
fn report_err(&self, nvim: &mut NeovimApi);
|
||||
}
|
||||
|
||||
impl<T> ErrorReport for result::Result<T, String> {
|
||||
impl<T> ErrorReport for result::Result<T, CallError> {
|
||||
fn report_err(&self, _: &mut NeovimApi) {
|
||||
if let &Err(ref msg) = self {
|
||||
println!("{}", msg);
|
||||
if let &Err(ref err) = self {
|
||||
println!("{}", err);
|
||||
//nvim.report_error(&err_msg).expect("Error report error :)");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user