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

Wrong matching (HTML) #19

Closed
ahmedelgabri opened this issue Jan 14, 2018 · 1 comment
Closed

Wrong matching (HTML) #19

ahmedelgabri opened this issue Jan 14, 2018 · 1 comment

Comments

@ahmedelgabri
Copy link

I was working with a very simple HTML when I noticed that the highlighting is not right & that also the transmute doesn't work, here is the HTML

<ul class="btn-group">
  <li>
  </li>
</ul>

and here is the issue:

wrong-match

and here are my settings:

let g:matchup_transmute_enabled = 1
let g:matchup_matchparen_deferred = 1
@ahmedelgabri ahmedelgabri changed the title Wrong highlighting Wrong matching Jan 14, 2018
andymass added a commit that referenced this issue Jan 20, 2018
andymass added a commit that referenced this issue Jan 20, 2018
@andymass
Copy link
Owner

andymass commented Jan 20, 2018

This matching is actually "by design." The intent is to allow you to iterate through a set of list items using %. It's similar to what happens with if -> else -> endif in vimscript. Note also this behavior is inherited from matchit.zip and is not a proper bug in match-up.

However- I agree that it is quite surprising in HTML. In particular, the chain </li> to <li> to </ul> breaks a goal that % should form a closed cycle which eventually returns to the starting word. I would be interested in an enhancement that allows you to iterate through list items while also matching tags as normal, but I have not come up with an idea how to do this yet.

If you simply prefer to disable it and treat <ul>/<li> like any other tag, you can place this in your vimrc. This also repairs the transmute ability.

let g:matchup_matchpref = { 'html': { 'nolists': 1 } }

@andymass andymass pinned this issue Sep 1, 2019
@andymass andymass changed the title Wrong matching Wrong matching (HTML) Sep 1, 2019
@andymass andymass unpinned this issue Sep 1, 2020
@andymass andymass pinned this issue Sep 1, 2020
HTML / Javascript cleanup automation moved this from To do to Done Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants