ziontee113 / syntax-tree-surfer

A plugin for Neovim that helps you surf through your document and move elements around using the nvim-treesitter API.
MIT License
469 stars 9 forks source link

Include trailing commas when highlighting `STSSelectParentNode` - Lua #10

Closed jay-babu closed 2 years ago

jay-babu commented 2 years ago

Hello,

When I call STSSelectParentNode, it highlights the current node, but for some reason doesn't include the comma at the end when it is (I think) part of the node as shown in the screenshot. I was wondering if it is possible to somehow include when selecting.

image

jay-babu commented 2 years ago

Line 69 is highlighted with the comma being included

ziontee113 commented 2 years ago

HI @jayp0521, commas , are their own kind of node. It's not part of the node you're selecting. If you have TreesitterPlayground, open it up and press a, you'll see what I mean. You can still swap nodes without selecting the ,.