[EDITED] placeholders highlighting problem
sim590 opened this issue · 4 comments
[EDITED]
I can illustrate the issue with an example. Let's say we have this snippet :
snippet def
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
"""${3:docstring for $1}"""
${0}
This is a python
snippet from vim-snippets. If you define your function name with more characters than there is in the placeholder's default value, you will get something like this :
def longernamethanfname():
"""docstring for longernamethanfname"""
The thing here is that after pressing tab to get to the docstring, the string docstring for longernamethanfname
should be highlighted for replacement, but it's highlighted only up to "longe".
It turns out that SnipMate actually doesn't realize the placeholder expands/contracts as one changes the first tab stop, and both "snake" and "camel" have the same number of characters as "fname". Unfortunately the fix for this is not as straightforward as I hoped, but I'll continue working on it. In the meantime, allow me to plug the recently added version 1 snippet parser, for which this is not a problem. Note that while this particular snippet transfers fine, not every snippet works the same in both versions.
Should I reopen another issue since this is one is not really accurate ?
No worries. The changed title helps too. Anyway, I just pushed a fix for it. Thanks for the report!
Thank you for fixing that quickly !!!