diff --git a/crates/api/src/opts/clear_autocmds.rs b/crates/api/src/opts/clear_autocmds.rs index 8d57a1d8..8e81dcda 100644 --- a/crates/api/src/opts/clear_autocmds.rs +++ b/crates/api/src/opts/clear_autocmds.rs @@ -10,6 +10,10 @@ pub struct ClearAutocmdsOpts { /// Only clear the autocommands local to a specific `Buffer`. Cannot be /// used together with [`patterns`](ClearAutocmdsOptsBuilder::patterns). + #[cfg(feature = "neovim-0-12")] // On 0.12 and above. + #[builder(argtype = "Buffer", inline = "{0}.0")] + buf: types::BufHandle, + #[cfg(not(feature = "neovim-0-12"))] // On 0.11 and bellow. #[builder(argtype = "Buffer", inline = "{0}.0")] buffer: types::BufHandle, diff --git a/crates/api/src/opts/create_autocmd.rs b/crates/api/src/opts/create_autocmd.rs index e4008d60..9f91299a 100644 --- a/crates/api/src/opts/create_autocmd.rs +++ b/crates/api/src/opts/create_autocmd.rs @@ -12,6 +12,10 @@ pub struct CreateAutocmdOpts { mask: u64, /// A specific `Buffer` for buffer-local autocommands. + #[cfg(feature = "neovim-0-12")] // On 0.12 and above. + #[builder(argtype = "Buffer", inline = "{0}.0")] + buf: types::BufHandle, + #[cfg(not(feature = "neovim-0-12"))] // On 0.11 and bellow. #[builder(argtype = "Buffer", inline = "{0}.0")] buffer: types::BufHandle, diff --git a/crates/api/src/opts/exec_autocmds.rs b/crates/api/src/opts/exec_autocmds.rs index be7b37bf..a6832dd1 100644 --- a/crates/api/src/opts/exec_autocmds.rs +++ b/crates/api/src/opts/exec_autocmds.rs @@ -10,6 +10,10 @@ pub struct ExecAutocmdsOpts { /// A specific [`Buffer`] for buffer-local autocommands. Cannot be used /// together with [`patterns`](ExecAutocmdsOptsBuilder::patterns). + #[cfg(feature = "neovim-0-12")] // On 0.11 and bellow. + #[builder(argtype = "Buffer", inline = "{0}.0")] + buf: types::BufHandle, + #[cfg(not(feature = "neovim-0-12"))] // On 0.12 and above. #[builder(argtype = "Buffer", inline = "{0}.0")] buffer: types::BufHandle, diff --git a/crates/api/src/opts/get_autocmds.rs b/crates/api/src/opts/get_autocmds.rs index 6da5ac8e..3114833f 100644 --- a/crates/api/src/opts/get_autocmds.rs +++ b/crates/api/src/opts/get_autocmds.rs @@ -44,6 +44,10 @@ pub struct GetAutocmdsOpts { /// Get the autocommands local to a specific `Buffer`. Cannot be used /// together with `patterns`. + #[cfg(feature = "neovim-0-12")] // On 0.12 and above. + #[builder(argtype = "Buffer", inline = "{0}.into()")] + buf: Object, + #[cfg(not(feature = "neovim-0-12"))] // On 0.11 and bellow. #[builder(argtype = "Buffer", inline = "{0}.into()")] buffer: Object, }