nvim_oxi_api/opts/
clear_autocmds.rs

1use crate::Buffer;
2use crate::StringOrInt;
3
4/// Options passed to [`clear_autocmds()`](crate::clear_autocmds).
5#[derive(Clone, Debug, Default, macros::OptsBuilder)]
6#[repr(C)]
7pub struct ClearAutocmdsOpts {
8    #[builder(mask)]
9    mask: u64,
10
11    /// Only clear the autocommands local to a specific `Buffer`. Cannot be
12    /// used together with [`patterns`](ClearAutocmdsOptsBuilder::patterns).
13    #[builder(argtype = "Buffer", inline = "{0}.0")]
14    buffer: types::BufHandle,
15
16    /// Clear all the autocommands triggered by one or more of the specified
17    /// events.
18    #[builder(
19        generics = "'a, I: IntoIterator<Item = &'a str>",
20        method = "events",
21        argtype = "I",
22        inline = "types::Array::from_iter({0}).into()"
23    )]
24    event: types::Object,
25
26    /// Only clear the autocommands matching specific patterns. For example, if
27    /// you have `"*.py"` as a pattern for a particular autocommand, you must
28    /// pass that exact pattern to clear it. Cannot be used together with
29    /// [`buffer`](ClearAutocmdsOptsBuilder::buffer).
30    #[builder(
31        generics = "G: StringOrInt",
32        argtype = "G",
33        inline = "{0}.to_object()"
34    )]
35    group: types::Object,
36
37    /// Only clear the autocommands belonging to a specific augroup. The
38    /// augroup can be specified by both id and name.
39    #[builder(
40        generics = "'a, I: IntoIterator<Item = &'a str>",
41        method = "patterns",
42        argtype = "I",
43        inline = "types::Array::from_iter({0}).into()"
44    )]
45    pattern: types::Object,
46}