vim-matchup icon indicating copy to clipboard operation
vim-matchup copied to clipboard

JSX with inner . separator doesn't match closing tag

Open andrewplummer opened this issue 3 years ago • 1 comments

With the following JSX:

<Layout>
  <Layout.Group horizontal center spread>
  </Layout.Group>
</Layout>

The % key will not jump to (or highlight) the closing tag for <Layout>. I'm using this with the maxmellon/vim-jsx-pretty, unsure which is responsible for the issue.

Platform: OSX 10.15.6 Version: MacVim 8.2.539

andrewplummer avatar Jul 22 '20 12:07 andrewplummer

This is an interesting one. vim-jsx-pretty uses a b:match_words which is subtly broken..

vim-jsx-pretty: <\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>

match-up's html: <\@<=\([^/][^ \t>]*\)\g{hlend}\%(>\|$\|[ \t][^>]*\%(>\|$\)\):<\@<=/\1\g{hlend}>

If you try your example in a plain html file, it works.

andymass avatar Aug 14 '20 23:08 andymass

Works great! Thank you!

andrewplummer avatar Apr 03 '23 11:04 andrewplummer