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

erb nested Inline control flow matching is broken #391

Open
amerov opened this issue Feb 6, 2019 · 10 comments
Open

erb nested Inline control flow matching is broken #391

amerov opened this issue Feb 6, 2019 · 10 comments
Labels

Comments

@amerov
Copy link

amerov commented Feb 6, 2019

screenshot from 2019-02-06 21-53-27

@tpope
Copy link
Member

tpope commented Feb 6, 2019

It's working fine for me. What does :echo b:ruby_no_expensive report?

@amerov
Copy link
Author

amerov commented Feb 6, 2019

It's working fine for me. What does :echo b:ruby_no_expensive report?

1

@NoahTheDuke
Copy link

I experience this as well, and I also get a 1 when I run that command.

@tpope
Copy link
Member

tpope commented Feb 6, 2019

With an unfamiliar color scheme I can't tell exactly what "this" is.

@dkearns
Copy link
Member

dkearns commented Feb 7, 2019

The if modifier is being incorrectly match(it)ed with end.

@tpope
Copy link
Member

tpope commented Feb 7, 2019

Oh that I am experiencing and I am doubtful it can be fixed. Is the highlighting from a version of matchit newer than ships with Vim?

@dkearns
Copy link
Member

dkearns commented Feb 7, 2019

I assumed the highlighting was some sort of matchpairs plugin.

@amerov
Copy link
Author

amerov commented Feb 7, 2019

I use vim-matchup
but I was try without this plugin and navigate with % I got some result.

@tpope
Copy link
Member

tpope commented Feb 7, 2019

So in a normal Ruby file, if and end are paired into a syntax group, and the syntax group is leveraged for matchit pairing. Creating a syntax group isn't possible with HTML in the middle so that feature is disabled in ERB files. It would be probably possible to mitigate this by adding a look-behind to the \<if\> regexp. I am not likely to attempt this personally.

@dkearns
Copy link
Member

dkearns commented Feb 8, 2019

@amerov If you're interested in trying to fix this yourself you might find some useful patterns in both the syntax and indent files.

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

No branches or pull requests

4 participants