Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--helix-core/src/snippets/parser.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/helix-core/src/snippets/parser.rs b/helix-core/src/snippets/parser.rs
index 3d06e417..74e940da 100644
--- a/helix-core/src/snippets/parser.rs
+++ b/helix-core/src/snippets/parser.rs
@@ -361,7 +361,20 @@ mod test {
Text(")".into()),
]),
parse("match(${1:Arg1})")
- )
+ );
+ // The `$0` tabstop should not have placeholder text. The parser should handle this case
+ // normally and then the placeholder text should be discarded during elaboration.
+ assert_eq!(
+ Ok(vec![
+ Text("sizeof(".into()),
+ Placeholder {
+ tabstop: 0,
+ value: vec![Text("expression-or-type".into())],
+ },
+ Text(")".into()),
+ ]),
+ parse("sizeof(${0:expression-or-type})")
+ );
}
#[test]