nvim-treesitter-textobjects icon indicating copy to clipboard operation
nvim-treesitter-textobjects copied to clipboard

How to target the object and include the before text?

Open fovj opened this issue 4 years ago • 0 comments

For example, in jsx, the each attribute of element are split by <space>. But Treesitter doesn't include the separator(space).

截屏2021-06-17 下午8 44 57

When I delete this textobj(test={true}), the `' before is still there. This is correct, but it is inconvenient.

截屏2021-06-17 下午8 47 39

Then I need to delete that space manually.

图片

So, is there any to target the attribute, but also include the space(one or more) before?

and here's my config now.

; jsx attributes
(jsx_self_closing_element attribute: (_) @attribute.outer)
(jsx_element open_tag: (_ attribute: (_) @attribute.outer))

fovj avatar Jun 17 '21 12:06 fovj