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

Matchit support has problems with unclosed tags #152

Open
AndrewRadev opened this issue Aug 30, 2021 · 0 comments
Open

Matchit support has problems with unclosed tags #152

AndrewRadev opened this issue Aug 30, 2021 · 0 comments

Comments

@AndrewRadev
Copy link

Here's an example that fails for me on the current master:

const foo = <Foo>
  <FooBar />
</Foo>

Putting the cursor on the opening <Foo>, tapping % doesn't jump to the closing one, because between them there's this self-closed tag that starts with <Foo.

While there might be a fix to the pattern, I feel like a perfectly valid choice is to remove the matchit words, since Vim's runtime files seem to include one already: https://github.com/vim/vim/blob/a91871262670f9d3a4e5d1c5c6dbc02f85625f7d/runtime/ftplugin/javascript.vim#L52-L58

This is probably relatively recent -- I'm guessing that jsx-pretty provided support before Vim did, but maybe it's time to retire it? Or you could consider porting it here for older Vim installations. Admittedly, I'm not 100% sure it works correctly in all cases, but at least for this one it seems to do the trick.

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

1 participant