mirror of
https://github.com/noib3/nvim-oxi.git
synced 2025-08-04 19:08:31 +00:00
Bind to nvim_win_set_hl_ns
instead of nvim_win_set_hl
(#220)
This commit is contained in:
parent
f751ef4324
commit
6a2483cb4d
3 changed files with 9 additions and 6 deletions
|
@ -108,9 +108,9 @@ extern "C" {
|
|||
err: *mut Error,
|
||||
);
|
||||
|
||||
// https://github.com/neovim/neovim/blob/master/src/nvim/api/window.c#L456
|
||||
// https://github.com/neovim/neovim/blob/release-0.10/src/nvim/api/window.c#L464
|
||||
#[cfg(feature = "neovim-0-10")] // On 0.10 and nightly.
|
||||
pub(crate) fn nvim_win_set_hl(
|
||||
pub(crate) fn nvim_win_set_hl_ns(
|
||||
win: WinHandle,
|
||||
ns_id: Integer,
|
||||
err: *mut Error,
|
||||
|
|
|
@ -348,7 +348,7 @@ impl Window {
|
|||
choose!(err, ())
|
||||
}
|
||||
|
||||
/// Binding to [`nvim_win_set_hl()`][1].
|
||||
/// Binding to [`nvim_win_set_hl_ns()`][1].
|
||||
///
|
||||
/// Sets the highlight namespace for this window. This will the highlights
|
||||
/// defined with [`set_hl`](crate::set_hl) for the given namespace, but
|
||||
|
@ -356,15 +356,15 @@ impl Window {
|
|||
///
|
||||
/// This takes precedence over the `winhighlight` option.
|
||||
///
|
||||
/// [1]: https://neovim.io/doc/user/api.html#nvim_win_set_hl()
|
||||
/// [1]: https://neovim.io/doc/user/api.html#nvim_win_set_hl_ns()
|
||||
#[cfg(feature = "neovim-0-10")] // On 0.10 and nightly.
|
||||
#[cfg_attr(
|
||||
docsrs,
|
||||
doc(cfg(any(feature = "neovim-0-10", feature = "neovim-nightly")))
|
||||
)]
|
||||
pub fn set_hl(&mut self, ns_id: u32) -> Result<()> {
|
||||
pub fn set_hl_ns(&mut self, ns_id: u32) -> Result<()> {
|
||||
let mut err = nvim::Error::new();
|
||||
unsafe { nvim_win_set_hl(self.0, ns_id.into(), &mut err) };
|
||||
unsafe { nvim_win_set_hl_ns(self.0, ns_id.into(), &mut err) };
|
||||
choose!(err, ())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue