Skip to content

Fix cursor desync on Shift+J/K reorder with expanded tmux windows#469

Open
Steven17D wants to merge 1 commit intoasheshgoplani:mainfrom
Steven17D:fix/cursor-desync-on-reorder
Open

Fix cursor desync on Shift+J/K reorder with expanded tmux windows#469
Steven17D wants to merge 1 commit intoasheshgoplani:mainfrom
Steven17D:fix/cursor-desync-on-reorder

Conversation

@Steven17D
Copy link
Copy Markdown
Contributor

Summary

  • After reordering sessions with Shift+J/K, the cursor position is now determined by finding the moved item's new position by ID, instead of blindly incrementing/decrementing h.cursor
  • Adds moveCursorToGroup helper (mirrors existing moveCursorToSession) for group reordering
  • Fixes cursor drift that occurs when sessions have multiple tmux windows expanded, since expanded windows take extra visual rows in the flat item list

Test plan

  • Expand tmux windows on multiple sessions, then reorder with Shift+J/K — cursor should stay on the moved session
  • Reorder groups with Shift+J/K — cursor should stay on the moved group
  • Reorder sessions without expanded windows — behavior unchanged

After reordering sessions, find the moved item's new position by ID
instead of blindly incrementing/decrementing the cursor. This prevents
cursor drift when sessions have multiple tmux windows expanded, which
take extra visual rows in the flat item list.
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