Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

highlighting issue when using mirrors as a default value #248

Closed
Benjarmil opened this issue Mar 16, 2017 · 5 comments
Closed

highlighting issue when using mirrors as a default value #248

Benjarmil opened this issue Mar 16, 2017 · 5 comments

Comments

@Benjarmil
Copy link

Benjarmil commented Mar 16, 2017

Given this snippet :

snippet log
	console.log(${1:'data'}, ${2:$1})

You are able to expand and replace 'data'. and as expected the changes are mirrored into the default value of the second tabstop. hitting tab again will highlight the next tabstop as expected. The problem is that the character count highlighted will always be the same as the original default value no matter how large or small the new value is ( in this case, 'data', 6 characters will be highlighted. )

I believe this to be the same as issue #182

GVIM - 7.4, MS-Windows 32-bit GUI version with OLE support
vim-snipmate highlight bug

@ajzafar
Copy link
Collaborator

ajzafar commented Apr 1, 2017

As far as I can tell, this is only a problem with version 0 of the snippet parser. I consider this legacy code. Given that I added version 1 over two years ago and that the version 0 code is very hard to work with, I'm not inclined to fix this. Please convert your snippets to version 1 and start using that.

If I'm wrong that this issue only pertains to the version 0 parser, please reopen this. Thank you.

@ajzafar ajzafar closed this as completed Apr 1, 2017
@ErichDonGubler
Copy link

@ajzafar: That's fair that you want to stick with the latest version of the parser. Don't blame you there! I see you have mention of the parser version in the changelog, but I believe I can speak for both of us when stating that neither of us had any idea that there was a different parser available. Furthermore, as you can see from the snippet file on the left in the GIF...there's no snippet version specified, at least that I can see. Wouldn't this apply the version 1 parser, then? Or is version 0 simply used by default?

Whatever the resolution actually is, the fact that this confused us might indicate that the FAQs, or probably even the main README, should be updated. Discovering what you're talking about isn't exactly easy. Would you be open to a PR implementing this, after we test the fix you propose?

@ErichDonGubler
Copy link

ErichDonGubler commented Apr 6, 2017

Another question that might obviated the long-winded previous comment of mine: why the new engine NOT the default?

ajzafar added a commit that referenced this issue Apr 20, 2017
@ajzafar
Copy link
Collaborator

ajzafar commented Apr 20, 2017

@ErichDonGubler The documentation has mentioned the different parser versions since I implemented version 1. Reading through it again now though, I can see there's a lot of room for improvement. So I just improved it and added a FAQ entry to the README in a9802f2.

Version 0 is still the default because many users will require changes to at least some of their snippets. For most these changes will be minor, but the honza/vim-snippets repo in particular will take some time to switch over. However it's been quite a while now, so maybe after I cut a new release the default will change.

In any case, if you have any further suggestions for improving the docs (and really, I do welcome them!), please open a new issue. Thank you!

@ErichDonGubler
Copy link

Just wanted to report this as fixed for me. Thanks for the responses!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants