Skip to content

feat(move,swap): wrapping around sibling lists#885

Open
mazunki wants to merge 1 commit intonvim-treesitter:mainfrom
mazunki:feat-wrapping
Open

feat(move,swap): wrapping around sibling lists#885
mazunki wants to merge 1 commit intonvim-treesitter:mainfrom
mazunki:feat-wrapping

Conversation

@mazunki
Copy link
Copy Markdown

@mazunki mazunki commented May 8, 2026

I was a bit surprised that @parameter.inner would go to the next procedure call, and not stop at the end of the parameter list when swapping order.

I've added support for opts = { wrap = true } which limits the scope in which move.goto_{next,previous}{,_end,_start} and swap.swap_{next,previous} operate.

By default, this feature is disabled, and the API remains unchanged: so the feature is entirely opt-in. My opinion is that at the very least, the swapping commands should wrap around its siblings, but I don't intend on breaking expectations with this PR.

I haven't tested this on other things than parameter lists, but I suspect it would work with them just the same.

this adds support for wrapping around on parameter lists by querying the
surrounding scope
@mazunki
Copy link
Copy Markdown
Author

mazunki commented May 8, 2026

rebased to address linter issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant