Fix embed mode

This commit is contained in:
daa 2016-03-19 14:32:59 +03:00
parent 1043d9ac8e
commit dc1bf55a46
2 changed files with 6 additions and 5 deletions

3
Cargo.lock generated
View File

@ -5,7 +5,7 @@ dependencies = [
"cairo-rs 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
"neovim-lib 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"neovim-lib 0.1.0",
"rmp 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -195,7 +195,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "neovim-lib"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rmp 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rmp-serialize 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -1,4 +1,4 @@
use neovim_lib::{Neovim, Session};
use neovim_lib::{Neovim, NeovimApi, Session};
use std::io::{Result, Error, ErrorKind};
use rmp::Value;
@ -8,12 +8,14 @@ pub struct Nvim {
impl Nvim {
pub fn start() -> Result<Nvim> {
let mut session = try!(Session::new_tcp("127.0.0.1:6666"));
//let mut session = try!(Session::new_child());
//let mut session = try!(Session::new_tcp("127.0.0.1:6666"));
let mut session = try!(Session::new_child());
session.start_event_loop_cb(Nvim::cb);
let mut nvim = Neovim::new(session);
// fix neovim --embed bug to start embed mode
nvim.input("i").unwrap();
try!(nvim.ui_attach(80, 24, true).map_err(|e| Error::new(ErrorKind::Other, e)));
Ok(Nvim {