chrisgrieser/nvim-various-textobjs

[Bug]: htmlAttribute support vue,jsx,html attr

kola-web opened this issue · 3 comments

Bug Description

The current htmlAttribute match is not robust enough

Relevant Screenshot

vue
Need to match these six
`vue

`

jsx
Need to match these one
`jsx

`

Reproduction & Sample Text

before:


after:

expected:

neovim version

NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3

     系统 vimrc 文件: "$VIM/sysinit.vim"
         $VIM 预设值: "/opt/homebrew/Cellar/neovim/0.9.0/share/nvim"

Run :checkhealth for more info

Make sure you have done the following

  • I have updated to the latest version of the plugin.

@chrisgrieser I actually wrote these three regular expressions to cover the situation I described above, but I'm not sure how to add him to the plugin
lua (([@:%-_%w]+=["]).-(["])) (([@:%-_%w]+=[{]).-([}])) (([@:%-_%w]+=[']).-([']))

hmm, that will be a bit tricky, since the current implementation of the textobj search algorithm only accepts one pattern.

So I implementing multiple patterns would be a bit more work since it requires rewriting that function…

I have implemented searching for multiple patterns. However, since the post is lacking any examples ("needs to match these six" does not have examples following, sample text is missing, …), I cannot do anything about it, and this issue is inactionable. I am therefore closing this.

If this is still relevant, please open a new issue, without skipping all necessary steps of the issue there.