hsnips icon indicating copy to clipboard operation
hsnips copied to clipboard

Can't trigger snippet with specific regular expression

Open Entoryvekum opened this issue 2 years ago • 0 comments

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.

Entoryvekum avatar Jan 06 '23 13:01 Entoryvekum