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

In html-like syntax, can the match include only the tag and not its properties? #356

Open
prurigro opened this issue Aug 19, 2024 · 0 comments

Comments

@prurigro
Copy link

Is your feature request related to a problem? Please describe.

Currently in html-like syntax (html, vue, blade, etc), when selecting a tag that includes properties, both the tag and the properties are matched. There are two issues I'm running into with this:

  1. <div class="modal alerts"> looks the same as <div class="modal_alerts"> when the cursor is inside the matched div, and
  2. Double clicking selects words or %, with a priority on %, so double clicking on a long class name to select it selects the entire block.

This isn't an issue, but it also feels inconsistent that double clicking on the "cool" class in this highlights the block:

<div id="cool" class="cool">
    ...
</div>

while double clicking on the "cool" class in this highlights "cool":

<div
    id="cool"
    class="cool">

    ...
</div>

Describe the solution you'd like

If vim-matchup only considered the <div portion of the tag instead of <div ...> it would solve the above issues and make the behaviour more consistent between formatting styles.

Describe alternatives you've considered

Alternatively, there could be a toggle or regex override to allow people running into the same issues I am to get this behaviour if the current behaviour is helping some other use case.

Additional context

image

image

Thanks for your time!

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

No branches or pull requests

1 participant