Closed kevintraver closed 7 months ago
Instead the swap operation is allowed to continue after Task 3 is at the beginning of the list, and the swap then performs on the next outer node, which then swaps the tasks and completed objects.
What continues on the external node is correct and expected sibling-swap
behavior. The plugin looks for a suitable node to move to. At the moment when ^Task 3
is leftmost, the next suitable one is tasks
. This approach allows you to move any neighboring nodes in any language without any additional configuration.
However, you can try to implement the context restriction yourself using the fallback
option.
If you need tighter restrictions, have a look at other plugins with similar functionality: iswap.nvim
or nvim-treesitter-textobjects
.
Ok. Thank you for the explanation!
Example:
When the cursor is on
Task 3
, the swap should be limited to the items in array, and should stop whenTask 3
is at the beginning or end of the array.Instead the swap operation is allowed to continue after
Task 3
is at the beginning of the list, and the swap then performs on the next outer node, which then swaps thetasks
andcompleted
objects.