windwp / nvim-ts-autotag

Use treesitter to auto close and auto rename html tag
MIT License
1.62k stars 86 forks source link

Inconsitent behaviour with renaming. Scope problem? #119

Closed tom-gora closed 1 year ago

tom-gora commented 1 year ago

Using Lazy and default config with Nvim 0.9.1 in kitty.

The problem in details shown and recorded in asciinema along with description.

Expected: Rename tags automatically either by editing the opening tag or the closing markup tag. Input: ciwnew_tag Output: Works in general, but not for some tags; behaviour like unpredictable ??? Theory: Seems like having issues with determining scope when adjacent self-closing tags present ??? But 1. Inconsistent 2. Not sure if this plugin or treesitter itself at fault.

Recording: https://asciinema.org/a/590682

tom-gora commented 1 year ago

Closing. I did not notice I had some leftover artifacts in my html coming from some failed snippet experiments where self closing tags were closed with /> (i.e. alt while this syntax is allowed it confuses and breaks this plugin. Not sure if support for </> tag is needed. I believe it is not a very commonly used way of writing self closing tags. Still, it can pop up in projects here and there...