nvim_api/types/
cmd_magic.rs

1use nvim_types::{Dictionary, Object};
2use serde::Deserialize;
3
4#[non_exhaustive]
5#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Hash, Deserialize)]
6pub struct CmdMagic {
7    /// If `true` the `|` character is treated as a command separator and the
8    /// double quote character (`"`) is treated as the start of a comment.
9    pub bar: bool,
10
11    /// Whether the command expands filenames, resulting in characters like
12    /// `"%"`, `"#"` and other wildcards to be expanded.
13    pub file: bool,
14}
15
16impl From<CmdMagic> for Object {
17    fn from(magic: CmdMagic) -> Self {
18        Dictionary::from_iter([("file", magic.file), ("bar", magic.bar)])
19            .into()
20    }
21}