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.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/helix-core/src/command_line.rs b/helix-core/src/command_line.rs
index 960b247d..8e209d61 100644
--- a/helix-core/src/command_line.rs
+++ b/helix-core/src/command_line.rs
@@ -357,7 +357,7 @@ pub struct Token<'a> {
pub is_terminated: bool,
}
-impl Token<'_> {
+impl<'a> Token<'a> {
pub fn empty_at(content_start: usize) -> Self {
Self {
kind: TokenKind::Unquoted,
@@ -366,6 +366,15 @@ impl Token<'_> {
is_terminated: false,
}
}
+
+ pub fn expand(content: impl Into<Cow<'a, str>>) -> Self {
+ Self {
+ kind: TokenKind::Expand,
+ content_start: 0,
+ content: content.into(),
+ is_terminated: true,
+ }
+ }
}
#[derive(Debug)]