Cool stuff
This commit is contained in:
@@ -60,7 +60,7 @@ end, { desc = 'Select surrounding treesitter node' })
|
||||
local swappable_nodes = { 'argument', 'array_element_initializer', 'simple_parameter', 'string', 'integer', 'member_call_expression', 'method_declaration' }
|
||||
|
||||
local function closest_swappable_node(node)
|
||||
while node and not vim.list_contains(swappable_nodes, node:type()) do
|
||||
while node and not vim.list_contains(swappable_nodes, node:type()) and (not node:next_named_sibling() or not node:prev_named_sibling()) do
|
||||
node = node:parent()
|
||||
end
|
||||
return node
|
||||
|
||||
Reference in New Issue
Block a user