draivin / hsnips

HyperSnips: a powerful snippet engine for VS Code, inspired by vim's UltiSnips
MIT License
154 stars 25 forks source link

Can't trigger snippet with specific regular expression #145

Open Entoryvekum opened 1 year ago

Entoryvekum commented 1 year ago

Snippet with specific regular expression triggers can't be triggered by specific strings satisfying regex.

This is the first example I found: 1 2 3 4

In further testing more examples were found:

cpp.hsnips

snippet `a ((\W\S+)|(\w\S*)) ((\W\S+)|(\w\S*))`
test 
endsnippet

test.cpp

a aa aa

In this example, a aa a can trigger the snippet and to type in a aa aaa and delete the last character can also trigger the snippet.

cpp.hsnips

snippet `a \w\S`
test 
endsnippet

test.cpp

a a?

In this example, a a. a a@ a a- a a< can trigger the snippet.


All these examples were found using my computer, I'm not sure wether it is common and repeatable.