chrisbra / matchit

The matchit plugin from Vim
67 stars 9 forks source link

Matchit works incorrectly with some HTML tags #46

Closed lkintact closed 3 months ago

lkintact commented 3 months ago
  1. Put this text into the buffer:
    <ul>
    <li>List Item</li>
    </ul>
  2. Execute :set ft=html.
  3. Place the cursor on u in <ul> and press %. Instead of moving to </ul>, the cursor moves to <li>.
  4. Press % again. Instead of moving to </li>, the cursor moves to </ul>.

Vim 9.1.636, Matchit 1.20.

chrisbra commented 3 months ago

That is on purpose, I guess the reason being, tha it allows to jump from <ul> to each <li> item and then to the closing </ul> item. It also does the same for definitions <dl>-> <dd> -> <dt>

See https://github.com/vim/vim/blob/659713da338fc758317e4e600170b02887ae3727/runtime/ftplugin/html.vim#L36-L40

lkintact commented 3 months ago

I see, thanks for letting know.

chrisbra commented 3 months ago

closing then.