1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
use nvim_types::Object;
use serde::Deserialize;
use crate::object::{self, de::utils, FromObject};
#[non_exhaustive]
#[derive(Clone, Debug, Eq, PartialEq, Hash, Deserialize)]
pub struct CommandArgs {
#[serde(deserialize_with = "utils::empty_string_is_none")]
pub args: Option<String>,
pub bang: bool,
#[serde(deserialize_with = "utils::minus_one_is_none")]
pub count: Option<u32>,
pub fargs: Vec<String>,
pub line1: usize,
pub line2: usize,
#[serde(deserialize_with = "utils::empty_string_is_none")]
pub mods: Option<String>,
pub range: u8,
#[serde(rename = "reg", deserialize_with = "utils::empty_string_is_none")]
pub register: Option<String>,
#[cfg(feature = "nightly")]
#[cfg_attr(docsrs, doc(cfg(feature = "nightly")))]
pub smods: super::CommandModifiers,
}
impl FromObject for CommandArgs {
fn from_obj(obj: Object) -> crate::Result<Self> {
Self::deserialize(object::Deserializer::new(obj))
}
}