From b2ff0bdfc9b4fd64026bddfd1df88c83b1a49a2b Mon Sep 17 00:00:00 2001 From: Steve Loveless Date: Sun, 15 Sep 2024 13:53:35 -0700 Subject: [PATCH] Pushing changes to work on something else --- neovim_sys/src/api/private.rs | 3 +++ neovim_sys/src/lib.rs | 3 +-- nvim_api/src/nvim.rs | 9 +-------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/neovim_sys/src/api/private.rs b/neovim_sys/src/api/private.rs index 55b4ce8..4966135 100644 --- a/neovim_sys/src/api/private.rs +++ b/neovim_sys/src/api/private.rs @@ -29,4 +29,7 @@ extern "C" { /// If the return value is null, an error occurred, so you should check `error` for such. /// pub fn find_buffer_by_handle(buffer: Buffer, error: *mut LuaError) -> *const buf_T; + + /// https://github.com/neovim/neovim/blob/master/src/nvim/api/vim.c#L682 + pub fn nvim_get_option(name: NvimString, error: *mut LuaError) -> Object; } diff --git a/neovim_sys/src/lib.rs b/neovim_sys/src/lib.rs index 51abde8..543b525 100644 --- a/neovim_sys/src/lib.rs +++ b/neovim_sys/src/lib.rs @@ -12,7 +12,6 @@ clippy::pedantic, future_incompatible, missing_copy_implementations, - missing_docs, nonstandard_style, rust_2018_idioms, trivial_casts, @@ -27,8 +26,8 @@ pub mod buffer_defs; pub mod getchar; pub mod globals; pub mod option; -pub mod vim; pub mod types; +pub mod vim; #[cfg(test)] #[allow(dead_code)] diff --git a/nvim_api/src/nvim.rs b/nvim_api/src/nvim.rs index 1b48979..be90969 100644 --- a/nvim_api/src/nvim.rs +++ b/nvim_api/src/nvim.rs @@ -29,14 +29,7 @@ pub fn nvim_get_option(name: &str) -> Result { let api_name = NvimString::new(name)?; let mut out_err = LuaError::default(); - let object = unsafe { - private::get_option_from( - std::ptr::null(), - SReq::Global as i32, - api_name, - &mut out_err, - ) - }; + let object = unsafe { private::nvim_get_option(api_name, &mut out_err) }; if out_err.is_err() { Err(Error::from(out_err))