SirVer / ultisnips

UltiSnips - The ultimate snippet solution for Vim. Send pull requests to SirVer/ultisnips!
GNU General Public License v3.0
7.55k stars 691 forks source link

Ultisnips not recognizing snippet with hash key #1453

Open vikomen opened 2 years ago

vikomen commented 2 years ago
UltiSnips doesn't seem to be recognising the # key. I have the following snippet snippet `([A-Z])#` "bb" A ``rv = '\\mathbb{' + m[1] + '}'`` endsnippet **Expected behavior:** When pressing "A" "#" I would expect to get \mathbb{A} as my output. **Actual behavior:** When pressing "A" "#" I get A# as my output. **Steps to reproduce** 1) Add snippet `([A-Z])#` "bb" A ``rv = '\\mathbb{' + m[1] + '}'`` endsnippet to your snippets 2) Open a new file and press "A" and then "#"

1. 2. 3.


smjonas commented 2 years ago

Change the snippet to the following:

snippet "([A-Z])#" "bb" Ar
rv = '\\mathbb{' + m[1] + '}'
endsnippet

Since you are using a regular expression as the trigger, you need quotes and the r option.