Add a neovim-0-11 feature (#243)

This commit is contained in:
Riccardo Mazzarini 2025-05-23 16:56:20 +02:00 committed by GitHub
parent c2d1da63fb
commit dbcbce2216
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 73 additions and 62 deletions

View file

@ -16,10 +16,12 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
neovim: [v0.10.4, Nightly] neovim: [v0.10.4, v0.11.1, Nightly]
include: include:
- neovim: v0.10.4 - neovim: v0.10.4
features: "--features neovim-0-10" features: "--features neovim-0-10"
- neovim: v0.11.1
features: "--features neovim-0-11"
- neovim: Nightly - neovim: Nightly
features: "--features neovim-nightly" features: "--features neovim-nightly"

View file

@ -43,7 +43,8 @@ rustdoc-args = ["--cfg", "docsrs"]
[features] [features]
neovim-0-10 = ["api/neovim-0-10"] neovim-0-10 = ["api/neovim-0-10"]
neovim-nightly = ["neovim-0-10", "api/neovim-nightly"] neovim-0-11 = ["api/neovim-0-10", "api/neovim-0-11"]
neovim-nightly = ["neovim-0-11", "api/neovim-nightly"]
libuv = ["dep:libuv"] libuv = ["dep:libuv"]
mlua = ["dep:mlua"] mlua = ["dep:mlua"]

View file

@ -1,6 +1,11 @@
#[cfg(not(any(feature = "neovim-0-10", feature = "neovim-nightly")))] #[cfg(not(any(
feature = "neovim-0-10",
feature = "neovim-0-11",
feature = "neovim-nightly"
)))]
compile_error!( compile_error!(
"You must enable one of the features: neovim-0-10, neovim-nightly" "You must enable one of the features: neovim-0-10, neovim-0-11, \
neovim-nightly"
); );
fn main() { fn main() {

View file

@ -9,7 +9,8 @@ license.workspace = true
[features] [features]
neovim-0-10 = [] neovim-0-10 = []
neovim-nightly = ["neovim-0-10"] neovim-0-11 = ["neovim-0-10"]
neovim-nightly = ["neovim-0-11"]
[dependencies] [dependencies]
luajit = { workspace = true } luajit = { workspace = true }

View file

@ -14,7 +14,7 @@ use crate::{Buffer, Window};
/// ///
/// [1]: https://neovim.io/doc/user/api.html#nvim_exec() /// [1]: https://neovim.io/doc/user/api.html#nvim_exec()
#[cfg_attr( #[cfg_attr(
feature = "neovim-nightly", feature = "neovim-0-11", // On 0.11 and Nightly.
deprecated(since = "0.5.0", note = "use `exec2` instead") deprecated(since = "0.5.0", note = "use `exec2` instead")
)] )]
pub fn exec(src: &str, output: bool) -> Result<Option<String>> { pub fn exec(src: &str, output: bool) -> Result<Option<String>> {
@ -36,7 +36,7 @@ pub fn exec(src: &str, output: bool) -> Result<Option<String>> {
/// ///
/// [1]: https://neovim.io/doc/user/api.html#nvim_get_current_win() /// [1]: https://neovim.io/doc/user/api.html#nvim_get_current_win()
#[cfg_attr( #[cfg_attr(
feature = "neovim-nightly", feature = "neovim-0-11", // On 0.11 and Nightly.
deprecated(since = "0.5.0", note = "use `get_hl` instead") deprecated(since = "0.5.0", note = "use `get_hl` instead")
)] )]
pub fn get_hl_by_id(hl_id: u32, rgb: bool) -> Result<HighlightInfos> { pub fn get_hl_by_id(hl_id: u32, rgb: bool) -> Result<HighlightInfos> {
@ -55,7 +55,7 @@ pub fn get_hl_by_id(hl_id: u32, rgb: bool) -> Result<HighlightInfos> {
/// ///
/// [1]: https://neovim.io/doc/user/api.html#nvim_get_hl_by_name() /// [1]: https://neovim.io/doc/user/api.html#nvim_get_hl_by_name()
#[cfg_attr( #[cfg_attr(
feature = "neovim-nightly", feature = "neovim-0-11", // On 0.11 and Nightly.
deprecated(since = "0.5.0", note = "use `get_hl` instead") deprecated(since = "0.5.0", note = "use `get_hl` instead")
)] )]
pub fn get_hl_by_name(name: &str, rgb: bool) -> Result<HighlightInfos> { pub fn get_hl_by_name(name: &str, rgb: bool) -> Result<HighlightInfos> {
@ -78,7 +78,7 @@ pub fn get_hl_by_name(name: &str, rgb: bool) -> Result<HighlightInfos> {
/// ///
/// [1]: https://neovim.io/doc/user/api.html#nvim_get_option() /// [1]: https://neovim.io/doc/user/api.html#nvim_get_option()
#[cfg_attr( #[cfg_attr(
feature = "neovim-nightly", feature = "neovim-0-11", // On 0.11 and Nightly.
deprecated(since = "0.5.0", note = "use `get_option_value` instead") deprecated(since = "0.5.0", note = "use `get_option_value` instead")
)] )]
pub fn get_option<Opt>(name: &str) -> Result<Opt> pub fn get_option<Opt>(name: &str) -> Result<Opt>
@ -97,7 +97,7 @@ where
/// ///
/// [1]: https://neovim.io/doc/user/api.html#nvim_get_option_info() /// [1]: https://neovim.io/doc/user/api.html#nvim_get_option_info()
#[cfg_attr( #[cfg_attr(
feature = "neovim-nightly", feature = "neovim-0-11", // On 0.11 and Nightly.
deprecated(since = "0.5.0", note = "use `get_option_info2` instead") deprecated(since = "0.5.0", note = "use `get_option_info2` instead")
)] )]
pub fn get_option_info(name: &str) -> Result<OptionInfos> { pub fn get_option_info(name: &str) -> Result<OptionInfos> {
@ -115,7 +115,7 @@ pub fn get_option_info(name: &str) -> Result<OptionInfos> {
/// ///
/// [1]: https://neovim.io/doc/user/api.html#nvim_set_option() /// [1]: https://neovim.io/doc/user/api.html#nvim_set_option()
#[cfg_attr( #[cfg_attr(
feature = "neovim-nightly", feature = "neovim-0-11", // On 0.11 and Nightly.
deprecated(since = "0.5.0", note = "use `set_option_value` instead") deprecated(since = "0.5.0", note = "use `set_option_value` instead")
)] )]
pub fn set_option<Opt>(name: &str, value: Opt) -> Result<()> pub fn set_option<Opt>(name: &str, value: Opt) -> Result<()>
@ -142,7 +142,7 @@ impl Buffer {
/// ///
/// [1]: https://neovim.io/doc/user/api.html#nvim_buf_get_option() /// [1]: https://neovim.io/doc/user/api.html#nvim_buf_get_option()
#[cfg_attr( #[cfg_attr(
feature = "neovim-nightly", feature = "neovim-0-11", // On 0.11 and Nightly.
deprecated(since = "0.5.0", note = "use `get_option_value` instead") deprecated(since = "0.5.0", note = "use `get_option_value` instead")
)] )]
pub fn get_option<Opt>(&self, name: &str) -> Result<Opt> pub fn get_option<Opt>(&self, name: &str) -> Result<Opt>
@ -164,7 +164,7 @@ impl Buffer {
/// ///
/// [1]: https://neovim.io/doc/user/api.html#nvim_buf_set_option() /// [1]: https://neovim.io/doc/user/api.html#nvim_buf_set_option()
#[cfg_attr( #[cfg_attr(
feature = "neovim-nightly", feature = "neovim-0-11", // On 0.11 and Nightly.
deprecated(since = "0.5.0", note = "use `set_option_value` instead") deprecated(since = "0.5.0", note = "use `set_option_value` instead")
)] )]
pub fn set_option<V>(&mut self, name: &str, value: V) -> Result<()> pub fn set_option<V>(&mut self, name: &str, value: V) -> Result<()>
@ -193,7 +193,7 @@ impl Window {
/// ///
/// [1]: https://neovim.io/doc/user/api.html#nvim_win_get_option() /// [1]: https://neovim.io/doc/user/api.html#nvim_win_get_option()
#[cfg_attr( #[cfg_attr(
feature = "neovim-nightly", feature = "neovim-0-11", // On 0.11 and Nightly.
deprecated(since = "0.5.0", note = "use `get_option_value` instead") deprecated(since = "0.5.0", note = "use `get_option_value` instead")
)] )]
pub fn get_option<Opt>(&self, name: &str) -> Result<Opt> pub fn get_option<Opt>(&self, name: &str) -> Result<Opt>
@ -215,7 +215,7 @@ impl Window {
/// ///
/// [1]: https://neovim.io/doc/user/api.html#nvim_win_set_option() /// [1]: https://neovim.io/doc/user/api.html#nvim_win_set_option()
#[cfg_attr( #[cfg_attr(
feature = "neovim-nightly", feature = "neovim-0-11", // On 0.11 and Nightly.
deprecated(since = "0.5.0", note = "use `set_option_value` instead") deprecated(since = "0.5.0", note = "use `set_option_value` instead")
)] )]
pub fn set_option<Opt>(&mut self, name: &str, value: Opt) -> Result<()> pub fn set_option<Opt>(&mut self, name: &str, value: Opt) -> Result<()>

View file

@ -166,7 +166,8 @@ extern "C" {
// https://github.com/neovim/neovim/blob/v0.10.0/src/nvim/api/vim.c#L360 // https://github.com/neovim/neovim/blob/v0.10.0/src/nvim/api/vim.c#L360
pub(crate) fn nvim_input( pub(crate) fn nvim_input(
#[cfg(feature = "neovim-nightly")] channel_id: u64, #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
channel_id: u64,
keys: NvimStr, keys: NvimStr,
) -> Integer; ) -> Integer;

View file

@ -1,5 +1,5 @@
/// Options passed to [`create_augroup()`](crate::create_augroup). /// Options passed to [`create_augroup()`](crate::create_augroup).
#[cfg(feature = "neovim-nightly")] // Only on Nightly. #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
#[derive(Clone, Debug, Default, macros::OptsBuilder)] #[derive(Clone, Debug, Default, macros::OptsBuilder)]
#[repr(C)] #[repr(C)]
pub struct CreateAugroupOpts { pub struct CreateAugroupOpts {
@ -12,14 +12,14 @@ pub struct CreateAugroupOpts {
} }
/// Options passed to [`create_augroup()`](crate::create_augroup). /// Options passed to [`create_augroup()`](crate::create_augroup).
#[cfg(not(feature = "neovim-nightly"))] // Only on 0.10. #[cfg(not(feature = "neovim-0-11"))] // Only on 0.10.
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]
#[repr(C)] #[repr(C)]
pub struct CreateAugroupOpts { pub struct CreateAugroupOpts {
clear: types::Object, clear: types::Object,
} }
#[cfg(not(feature = "neovim-nightly"))] // Only on 0.10. #[cfg(not(feature = "neovim-0-11"))] // Only on 0.10.
impl CreateAugroupOpts { impl CreateAugroupOpts {
#[inline(always)] #[inline(always)]
pub fn builder() -> CreateAugroupOptsBuilder { pub fn builder() -> CreateAugroupOptsBuilder {
@ -27,11 +27,11 @@ impl CreateAugroupOpts {
} }
} }
#[cfg(not(feature = "neovim-nightly"))] // Only on 0.10. #[cfg(not(feature = "neovim-0-11"))] // Only on 0.10.
#[derive(Clone, Default)] #[derive(Clone, Default)]
pub struct CreateAugroupOptsBuilder(CreateAugroupOpts); pub struct CreateAugroupOptsBuilder(CreateAugroupOpts);
#[cfg(not(feature = "neovim-nightly"))] // Only on 0.10. #[cfg(not(feature = "neovim-0-11"))] // Only on 0.10.
impl CreateAugroupOptsBuilder { impl CreateAugroupOptsBuilder {
/// Whether to clear existing commands if the group already exists. /// Whether to clear existing commands if the group already exists.
#[inline] #[inline]

View file

@ -1,7 +1,7 @@
use types::{Array, Integer}; use types::{Array, Integer};
use crate::trait_utils::StringOrListOfStrings; use crate::trait_utils::StringOrListOfStrings;
#[cfg(feature = "neovim-nightly")] #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
use crate::types::VirtLinesOverflow; use crate::types::VirtLinesOverflow;
use crate::types::{ExtmarkHlMode, ExtmarkVirtTextPosition}; use crate::types::{ExtmarkHlMode, ExtmarkVirtTextPosition};
@ -28,8 +28,8 @@ pub struct SetExtmarkOpts {
end_col: types::Integer, end_col: types::Integer,
/// Name of the highlight group used to highlight this mark. /// Name of the highlight group used to highlight this mark.
#[cfg(not(feature = "neovim-nightly"))] // Only on 0.10. #[cfg(not(feature = "neovim-0-11"))] // Only on 0.10.
#[cfg_attr(docsrs, doc(cfg(not(feature = "neovim-nightly"))))] #[cfg_attr(docsrs, doc(cfg(not(feature = "neovim-0-11"))))]
#[builder( #[builder(
generics = "Hl: crate::HlGroup", generics = "Hl: crate::HlGroup",
argtype = "Hl", argtype = "Hl",
@ -38,8 +38,8 @@ pub struct SetExtmarkOpts {
hl_group: types::HlGroupId, hl_group: types::HlGroupId,
/// Name of the highlight group used to highlight this mark. /// Name of the highlight group used to highlight this mark.
#[cfg(feature = "neovim-nightly")] // Only on Nightly. #[cfg(feature = "neovim-0-11")] // Only on Nightly.
#[cfg_attr(docsrs, doc(cfg(feature = "neovim-nightly")))] #[cfg_attr(docsrs, doc(cfg(feature = "neovim-0-11")))]
#[builder( #[builder(
generics = "Hl: crate::SetExtmarkHlGroup", generics = "Hl: crate::SetExtmarkHlGroup",
argtype = "Hl", argtype = "Hl",
@ -135,8 +135,8 @@ pub struct SetExtmarkOpts {
virt_lines_leftcol: types::Boolean, virt_lines_leftcol: types::Boolean,
/// Controls how to handle virtual lines wider than the window. /// Controls how to handle virtual lines wider than the window.
#[cfg_attr(docsrs, doc(cfg(feature = "neovim-nightly")))] #[cfg_attr(docsrs, doc(cfg(feature = "neovim-0-11")))]
#[cfg(feature = "neovim-nightly")] #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
#[builder(argtype = "VirtLinesOverflow", inline = "{0}.into()")] #[builder(argtype = "VirtLinesOverflow", inline = "{0}.into()")]
virt_lines_overflow: types::String, virt_lines_overflow: types::String,
@ -196,8 +196,8 @@ pub struct SetExtmarkOpts {
/// When called, lines in the range are not drawn at all (according to /// When called, lines in the range are not drawn at all (according to
/// `conceallevel`); the next unconcealed line is drawn instead. /// `conceallevel`); the next unconcealed line is drawn instead.
#[cfg_attr(docsrs, doc(cfg(feature = "neovim-nightly")))] #[cfg_attr(docsrs, doc(cfg(feature = "neovim-0-11")))]
#[cfg(feature = "neovim-nightly")] #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
#[builder(argtype = "()", inline = "{let _ = {0}; types::String::new()}")] #[builder(argtype = "()", inline = "{let _ = {0}; types::String::new()}")]
conceal_lines: types::String, conceal_lines: types::String,

View file

@ -76,7 +76,7 @@ pub struct SetHighlightOpts {
#[builder(skip)] #[builder(skip)]
sp: Object, sp: Object,
#[cfg(not(feature = "neovim-nightly"))] // Only on 0.10. #[cfg(not(feature = "neovim-0-11"))] // Only on 0.10.
#[builder( #[builder(
generics = "Hl: crate::HlGroup", generics = "Hl: crate::HlGroup",
argtype = "Hl", argtype = "Hl",
@ -84,7 +84,7 @@ pub struct SetHighlightOpts {
)] )]
link: Object, link: Object,
#[cfg(feature = "neovim-nightly")] // Only on Nightly. #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
#[builder( #[builder(
generics = "Hl: crate::HlGroup", generics = "Hl: crate::HlGroup",
argtype = "Hl", argtype = "Hl",
@ -92,11 +92,11 @@ pub struct SetHighlightOpts {
)] )]
link: types::HlGroupId, link: types::HlGroupId,
#[cfg(not(feature = "neovim-nightly"))] // Only on 0.10. #[cfg(not(feature = "neovim-0-11"))] // Only on 0.10.
#[builder(skip)] #[builder(skip)]
global_link: Object, global_link: Object,
#[cfg(feature = "neovim-nightly")] // Only on Nightly. #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
#[builder(skip)] #[builder(skip)]
global_link: types::HlGroupId, global_link: types::HlGroupId,

View file

@ -169,13 +169,13 @@ impl HlGroup for &str {
/// A trait implemented by types that can be passed to /// A trait implemented by types that can be passed to
/// [`SetExtmarkOptsBuilder::hl_group`](crate::opts::SetExtmarkOptsBuilder::hl_group). /// [`SetExtmarkOptsBuilder::hl_group`](crate::opts::SetExtmarkOptsBuilder::hl_group).
#[cfg(feature = "neovim-nightly")] // Only on Nightly. #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
#[cfg_attr(docsrs, doc(cfg(feature = "neovim-nightly")))] #[cfg_attr(docsrs, doc(cfg(feature = "neovim-0-11")))]
pub trait SetExtmarkHlGroup { pub trait SetExtmarkHlGroup {
fn into_object(self) -> Object; fn into_object(self) -> Object;
} }
#[cfg(feature = "neovim-nightly")] // Only on Nightly. #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
impl SetExtmarkHlGroup for Integer { impl SetExtmarkHlGroup for Integer {
#[inline] #[inline]
fn into_object(self) -> Object { fn into_object(self) -> Object {
@ -183,7 +183,7 @@ impl SetExtmarkHlGroup for Integer {
} }
} }
#[cfg(feature = "neovim-nightly")] // Only on Nightly. #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
impl SetExtmarkHlGroup for &str { impl SetExtmarkHlGroup for &str {
#[inline] #[inline]
fn into_object(self) -> Object { fn into_object(self) -> Object {
@ -191,7 +191,7 @@ impl SetExtmarkHlGroup for &str {
} }
} }
#[cfg(feature = "neovim-nightly")] // Only on Nightly. #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
impl<T: StringOrInt> SetExtmarkHlGroup for Vec<T> { impl<T: StringOrInt> SetExtmarkHlGroup for Vec<T> {
#[inline] #[inline]
fn into_object(self) -> Object { fn into_object(self) -> Object {

View file

@ -179,19 +179,19 @@ pub(crate) struct ParseCmdOutput {
nargs: Object, nargs: Object,
// Only on 0.10. // Only on 0.10.
#[cfg(not(feature = "neovim-nightly"))] #[cfg(not(feature = "neovim-0-11"))]
addr: Object, addr: Object,
// Only on Nightly. // On 0.11 and Nightly.
#[cfg(feature = "neovim-nightly")] #[cfg(feature = "neovim-0-11")]
addr: NvimString, addr: NvimString,
// Only on 0.10. // Only on 0.10.
#[cfg(not(feature = "neovim-nightly"))] #[cfg(not(feature = "neovim-0-11"))]
nextcmd: Object, nextcmd: Object,
// Only on 0.10. // Only on 0.10.
#[cfg(feature = "neovim-nightly")] #[cfg(feature = "neovim-0-11")]
nextcmd: NvimString, nextcmd: NvimString,
} }
@ -279,9 +279,9 @@ impl TryFrom<ParseCmdOutput> for CmdInfos {
} }
Ok(Self { Ok(Self {
#[cfg(not(feature = "neovim-nightly"))] // Only on 0.10. #[cfg(not(feature = "neovim-0-11"))] // Only on 0.10.
addr: utils::none_literal_is_none(Deserializer::new(addr))?, addr: utils::none_literal_is_none(Deserializer::new(addr))?,
#[cfg(feature = "neovim-nightly")] // Only on Nightly. #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
addr: utils::none_literal_is_none(Deserializer::new(addr.into()))?, addr: utils::none_literal_is_none(Deserializer::new(addr.into()))?,
args: deserialize(args)?, args: deserialize(args)?,
bang: deserialize(bang)?, bang: deserialize(bang)?,
@ -290,11 +290,11 @@ impl TryFrom<ParseCmdOutput> for CmdInfos {
magic: deserialize(magic)?, magic: deserialize(magic)?,
mods: deserialize(mods)?, mods: deserialize(mods)?,
nargs: deserialize(nargs)?, nargs: deserialize(nargs)?,
#[cfg(not(feature = "neovim-nightly"))] // Only on 0.10. #[cfg(not(feature = "neovim-0-11"))] // Only on 0.10.
nextcmd: utils::empty_string_is_none(Deserializer::new( nextcmd: utils::empty_string_is_none(Deserializer::new(
nextcmd, nextcmd,
))?, ))?,
#[cfg(feature = "neovim-nightly")] // Only on Nightly. #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
nextcmd: utils::empty_string_is_none(Deserializer::new( nextcmd: utils::empty_string_is_none(Deserializer::new(
nextcmd.into(), nextcmd.into(),
))?, ))?,

View file

@ -23,13 +23,13 @@ pub struct ExtmarkInfos {
#[serde(default)] #[serde(default)]
pub hl_eol: Option<bool>, pub hl_eol: Option<bool>,
#[cfg(not(feature = "neovim-nightly"))] // Only on 0.10. #[cfg(not(feature = "neovim-0-11"))] // Only on 0.10.
#[cfg_attr(docsrs, doc(cfg(not(feature = "neovim-nightly"))))] #[cfg_attr(docsrs, doc(cfg(not(feature = "neovim-0-11"))))]
#[serde(default)] #[serde(default)]
pub hl_group: Option<String>, pub hl_group: Option<String>,
#[cfg(feature = "neovim-nightly")] // Only on Nightly. #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
#[cfg_attr(docsrs, doc(cfg(feature = "neovim-nightly")))] #[cfg_attr(docsrs, doc(cfg(feature = "neovim-0-11")))]
#[serde(default)] #[serde(default)]
pub hl_group: Option<super::OneOrMore<String>>, pub hl_group: Option<super::OneOrMore<String>>,

View file

@ -53,8 +53,8 @@ pub struct WindowConfig {
pub hide: Option<bool>, pub hide: Option<bool>,
#[cfg_attr(docsrs, doc(cfg(feature = "neovim-nightly")))] #[cfg_attr(docsrs, doc(cfg(feature = "neovim-0-11")))]
#[cfg(feature = "neovim-nightly")] // Only on Nightly. #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
#[serde(default)] #[serde(default)]
pub mouse: bool, pub mouse: bool,
@ -294,8 +294,8 @@ pub struct WindowOpts {
bufpos: Array, bufpos: Array,
external: Boolean, external: Boolean,
focusable: Boolean, focusable: Boolean,
#[cfg_attr(docsrs, doc(cfg(feature = "neovim-nightly")))] #[cfg_attr(docsrs, doc(cfg(feature = "neovim-0-11")))]
#[cfg(feature = "neovim-nightly")] #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
mouse: Boolean, mouse: Boolean,
vertical: Boolean, vertical: Boolean,
zindex: Integer, zindex: Integer,
@ -361,7 +361,7 @@ impl From<&WindowConfig> for WindowOpts {
builder.focusable(focusable); builder.focusable(focusable);
} }
#[cfg(feature = "neovim-nightly")] #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
builder.mouse(config.mouse); builder.mouse(config.mouse);
if let Some(vertical) = config.vertical { if let Some(vertical) = config.vertical {
@ -429,7 +429,7 @@ impl TryFrom<WindowOpts> for WindowConfig {
footer_pos, footer_pos,
height, height,
hide, hide,
#[cfg(feature = "neovim-nightly")] #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
mouse, mouse,
noautocmd, noautocmd,
relative, relative,
@ -503,7 +503,7 @@ impl TryFrom<WindowOpts> for WindowConfig {
))?, ))?,
height: deserialize(height)?, height: deserialize(height)?,
hide: deserialize(hide)?, hide: deserialize(hide)?,
#[cfg(feature = "neovim-nightly")] #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
mouse, mouse,
noautocmd: deserialize(noautocmd)?, noautocmd: deserialize(noautocmd)?,
relative, relative,

View file

@ -483,7 +483,7 @@ where
{ {
unsafe { unsafe {
nvim_input( nvim_input(
#[cfg(feature = "neovim-nightly")] #[cfg(feature = "neovim-0-11")] // On 0.11 and Nightly.
LUA_INTERNAL_CALL, LUA_INTERNAL_CALL,
keys.into().as_nvim_str(), keys.into().as_nvim_str(),
) )

View file

@ -10,7 +10,8 @@ crate-type = ["cdylib"]
[features] [features]
default = ["neovim-0-10"] default = ["neovim-0-10"]
neovim-0-10 = ["nvim-oxi/neovim-0-10"] neovim-0-10 = ["nvim-oxi/neovim-0-10"]
neovim-nightly = ["neovim-0-10", "nvim-oxi/neovim-nightly"] neovim-0-11 = ["neovim-0-10", "nvim-oxi/neovim-0-11"]
neovim-nightly = ["neovim-0-11", "nvim-oxi/neovim-nightly"]
[dependencies] [dependencies]
all_asserts = "2.3" all_asserts = "2.3"

View file

@ -285,7 +285,7 @@ fn set_get_del_var() {
} }
// `api::{get,set}_option()` were deprecated on 0.11, so only test on 0.10. // `api::{get,set}_option()` were deprecated on 0.11, so only test on 0.10.
#[cfg(not(feature = "neovim-nightly"))] #[cfg(not(feature = "neovim-0-11"))] // Only on 0.10.
#[nvim_oxi::test] #[nvim_oxi::test]
fn set_get_option() { fn set_get_option() {
api::set_option("modified", true).unwrap(); api::set_option("modified", true).unwrap();