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

Escaped colon only seems to work inside a character class #351

Closed
wants to merge 1 commit into from

Conversation

matthewd
Copy link

At some point, % stopped working for me when pointing at an end.

Given:

if 1
  #
else
  #
end

Starting at the if and pressing % jumps to the else, again and it jumps to the end... but once there, it gets stuck. (And likewise for all other block forms.)

This seems to fix that.

TBH I haven't read through matchit.vim to work out whether this change should be necessary (or is just working around a bug therein, say), but at worst it seems a pretty safe accomodation.

@AndrewRadev
Copy link
Member

Hmm, that's very strange, I can't seem to reproduce this locally. Your change doesn't really break it for me, so I guess it makes sense to merge it, provided it fixes an issue on your end and changes nothing on our end. I'm still a bit nervous about merging something that I don't fully understand.

Could you let me know what your current Vim version is? I'd like to see if it really is some matchit bug at a particular Vim runtime version.

@tpope
Copy link
Member

tpope commented Aug 21, 2017

cpoptions can affect backslash interpretation. I think the answer is to drop the backslash entirely. [\:] will match both : and \.

@matthewd
Copy link
Author

Sorry I forgot to come back to this earlier.

I just dug a bit more, and realised I was using an ancient version of matchit -- 1.9, which predates the embarrassingly-relevant changes in 1.10.

I think I'll just close this now. 😅

@matthewd matthewd closed this Oct 30, 2017
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

Successfully merging this pull request may close these issues.

None yet

3 participants