From 85d3cd7045e0a17996de77b3faf9036418ab3624 Mon Sep 17 00:00:00 2001 From: daa Date: Sat, 11 Mar 2017 22:57:53 +0300 Subject: [PATCH] Small code cleanup --- src/lib.rs | 2 +- src/neovim.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index a3ffdcc..809dd4b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,7 +25,7 @@ pub mod session; pub mod neovim; pub mod neovim_api; -pub use neovim::Neovim; +pub use neovim::{Neovim, UiAttachOptions, CallError}; pub use neovim_api::NeovimApi; pub use session::Session; diff --git a/src/neovim.rs b/src/neovim.rs index 497348a..945057c 100644 --- a/src/neovim.rs +++ b/src/neovim.rs @@ -9,14 +9,14 @@ pub struct Neovim { pub session: Session, } -pub struct Options { +pub struct UiAttachOptions { rgb: bool, popupmenu_external: bool, } -impl Options { - pub fn new() -> Options { - Options { +impl UiAttachOptions { + pub fn new() -> UiAttachOptions { + UiAttachOptions { rgb: true, popupmenu_external: false, } @@ -93,9 +93,9 @@ impl Neovim { /// Register as a remote UI. /// /// After this method is called, the client will receive redraw notifications. - pub fn ui_attach(&mut self, width: u64, height: u64, opts: &Options) -> Result<(), CallError> { + pub fn ui_attach(&mut self, width: u64, height: u64, opts: UiAttachOptions) -> Result<(), CallError> { self.session - .call("ui_attach", &call_args!(width, height, opts.to_value_map())) + .call("nvim_ui_attach", &call_args!(width, height, opts.to_value_map())) .map_err(map_generic_error) .map(|_| ()) }