Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/command_line.rs')
| -rw-r--r-- | helix-core/src/command_line.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/helix-core/src/command_line.rs b/helix-core/src/command_line.rs index 8e209d61..db7a71d7 100644 --- a/helix-core/src/command_line.rs +++ b/helix-core/src/command_line.rs @@ -253,16 +253,22 @@ pub enum ExpansionKind { /// /// For example `%sh{echo hello}`. Shell, + /// Expand registers from the editor's state. + /// + /// For example `%reg{a}`. + Register, } impl ExpansionKind { - pub const VARIANTS: &'static [Self] = &[Self::Variable, Self::Unicode, Self::Shell]; + pub const VARIANTS: &'static [Self] = + &[Self::Variable, Self::Unicode, Self::Shell, Self::Register]; pub const fn as_str(&self) -> &'static str { match self { Self::Variable => "", Self::Unicode => "u", Self::Shell => "sh", + Self::Register => "reg", } } @@ -271,6 +277,7 @@ impl ExpansionKind { "" => Some(Self::Variable), "u" => Some(Self::Unicode), "sh" => Some(Self::Shell), + "reg" => Some(Self::Register), _ => None, } } |