mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 02:21:51 +00:00
feat(treesitter): expand selection to sibling node #38938
Problem: Can't expand treesitter-incremental-selection to the next and previous sibling nodes. Solution: Pressing `]N` in visual mode will expand the selection to the next sibling node, and `[N` will do the same with the previous node.
This commit is contained in:
@@ -64,6 +64,16 @@ describe('treesitter incremental-selection', function()
|
||||
|
||||
treeselect('select_parent')
|
||||
eq('foo(1)\nbar(2)\n', get_selected())
|
||||
|
||||
set_lines('quux(1,foo,bar,baz,qux,2)')
|
||||
feed('<esc>fbve')
|
||||
eq('bar', get_selected())
|
||||
|
||||
treeselect('select_grow_next')
|
||||
eq('bar,baz', get_selected())
|
||||
|
||||
treeselect('select_grow_prev')
|
||||
eq('foo,bar,baz', get_selected())
|
||||
end)
|
||||
|
||||
it('repeat', function()
|
||||
@@ -89,6 +99,14 @@ describe('treesitter incremental-selection', function()
|
||||
|
||||
treeselect('select_child', 2)
|
||||
eq('2', get_selected())
|
||||
|
||||
feed('<esc>F1')
|
||||
treeselect('select_grow_next', 2)
|
||||
eq('1,2,3', get_selected())
|
||||
|
||||
feed('<esc>f4v')
|
||||
treeselect('select_grow_prev', 2)
|
||||
eq('2,3,4', get_selected())
|
||||
end)
|
||||
|
||||
it('history', function()
|
||||
|
||||
Reference in New Issue
Block a user