Skip to content

fix(swap): Properly restore cursor and window view when swapping bufs - #501

Merged
mrjones2014 merged 1 commit into
v3from
mrj/push-vyxusolxuqlu
Sep 12, 2026
Merged

fix(swap): Properly restore cursor and window view when swapping bufs#501
mrjones2014 merged 1 commit into
v3from
mrj/push-vyxusolxuqlu

Conversation

@mrjones2014

Copy link
Copy Markdown
Collaborator
  • fix(swap): Properly restore cursor and window view when swapping bufs

Noticed this not behaving quite right.

@geodimm would you mind testing this with
config.swap.move_cursor = true and config.swap.move_cursor = false?

It should swap the buffers between nvim windows, and the buffers should
remain scrolled to the same file position and cursor should remain on
the correct line.

When config.swap.move_cursor = true, your cursor should follow the
swapped buf.

@geodimm

geodimm commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Hi,

I've just tested it and it behaves exactly like that.

Both keep the scrolling position and the cursor position in the respective buffer.
config.swap.move_cursor = false keeps the cursor on the same "side".
config.swap.move_cursor = true follows the swapped buffer.

Comment thread lua/smart-splits/swap.lua Outdated
@mrjones2014
mrjones2014 merged commit 0c21a39 into v3 Sep 12, 2026
4 checks passed
@mrjones2014
mrjones2014 deleted the mrj/push-vyxusolxuqlu branch September 12, 2026 22:41
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.

2 participants