Skip to content

Commit

Permalink
Pushing changes to work on something else
Browse files Browse the repository at this point in the history
  • Loading branch information
turboladen committed Sep 15, 2024
1 parent 836b229 commit b2ff0bd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
3 changes: 3 additions & 0 deletions neovim_sys/src/api/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
3 changes: 1 addition & 2 deletions neovim_sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
clippy::pedantic,
future_incompatible,
missing_copy_implementations,
missing_docs,
nonstandard_style,
rust_2018_idioms,
trivial_casts,
Expand All @@ -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)]
Expand Down
9 changes: 1 addition & 8 deletions nvim_api/src/nvim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,7 @@ pub fn nvim_get_option(name: &str) -> Result<Object, Error> {
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))
Expand Down

0 comments on commit b2ff0bd

Please sign in to comment.