Fix embed mode
This commit is contained in:
parent
1043d9ac8e
commit
dc1bf55a46
3
Cargo.lock
generated
3
Cargo.lock
generated
@ -5,7 +5,7 @@ dependencies = [
|
|||||||
"cairo-rs 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"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)",
|
"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)",
|
"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]]
|
[[package]]
|
||||||
name = "neovim-lib"
|
name = "neovim-lib"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rmp 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"rmp-serialize 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use neovim_lib::{Neovim, Session};
|
use neovim_lib::{Neovim, NeovimApi, Session};
|
||||||
use std::io::{Result, Error, ErrorKind};
|
use std::io::{Result, Error, ErrorKind};
|
||||||
use rmp::Value;
|
use rmp::Value;
|
||||||
|
|
||||||
@ -8,12 +8,14 @@ pub struct Nvim {
|
|||||||
|
|
||||||
impl Nvim {
|
impl Nvim {
|
||||||
pub fn start() -> Result<Nvim> {
|
pub fn start() -> Result<Nvim> {
|
||||||
let mut session = try!(Session::new_tcp("127.0.0.1:6666"));
|
//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_child());
|
||||||
|
|
||||||
session.start_event_loop_cb(Nvim::cb);
|
session.start_event_loop_cb(Nvim::cb);
|
||||||
|
|
||||||
let mut nvim = Neovim::new(session);
|
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)));
|
try!(nvim.ui_attach(80, 24, true).map_err(|e| Error::new(ErrorKind::Other, e)));
|
||||||
|
|
||||||
Ok(Nvim {
|
Ok(Nvim {
|
||||||
|
Loading…
Reference in New Issue
Block a user