nvim_oxi_api/opts/
exec_autocmds.rs

1use crate::Buffer;
2use crate::{StringOrInt, StringOrListOfStrings};
3
4/// Options passed to [`exec_autocmds()`](crate::exec_autocmds).
5#[derive(Clone, Debug, Default, macros::OptsBuilder)]
6#[repr(C)]
7pub struct ExecAutocmdsOpts {
8    #[builder(mask)]
9    mask: u64,
10
11    /// A specific [`Buffer`] for buffer-local autocommands. Cannot be used
12    /// together with [`patterns`](ExecAutocmdsOptsBuilder::patterns).
13    #[builder(argtype = "Buffer", inline = "{0}.0")]
14    buffer: types::BufHandle,
15
16    /// The autocommand group name or id to match against.
17    #[builder(
18        generics = "G: StringOrInt",
19        argtype = "G",
20        inline = "{0}.to_object()"
21    )]
22    group: types::Object,
23
24    /// Whether to process the modeline after the autocommands.
25    #[builder(argtype = "bool")]
26    modeline: types::Boolean,
27
28    /// Patterns to match against. Cannot be used together with
29    /// [`buffer`](ExecAutocmdsOptsBuilder::buffer).
30    #[builder(
31        generics = "P: StringOrListOfStrings",
32        method = "patterns",
33        argtype = "P",
34        inline = "{0}.to_object()"
35    )]
36    pattern: types::Object,
37
38    #[builder(
39        generics = "D: Into<types::Object>",
40        argtype = "D",
41        inline = "{0}.into()"
42    )]
43    data: types::Object,
44}