Repository navigation
Fix incorrect window labels when 10 or more windows are open - #554
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe window selector now updates and restores non-popup window-local UI values by iterating through the input window list, preserving positional correspondence between windows and indicator characters. ChangesWindow selector updates
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes window indicator label misalignment in fern’s window selector when 10+ windows are open by ensuring label assignment/restoration follows the explicit a:winnrs ordering rather than relying on dictionary key iteration order.
Changes:
- Assign statusline/winbar indicator labels by iterating
a:winnrsin-order, ensuring correct window-to-label correspondence. - Restore original statusline/winbar values by iterating
a:winnrs, keeping restoration consistent with the windows that were modified.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks 👍 |
Summary
Fixes incorrect window labels when 10 or more windows are open.
Description
When selecting a file through fern, window statuslines are labeled in alphabetical order (a, b, c ... i). When there are 10 or more windows, the labels become incorrect (b, c, d ... j, a).
Cause
The previous implementation relied on iterating over keys(store), which could produce an ordering different from a:winnrs. As a result, labels could be assigned to the wrong windows.
Solution
Iterate over
a:winnrsdirectly when assigning and restoring window labels, preserving the intended correspondence between window numbers and label characters.Testing
Reproduced the issue with 10 or more windows and verified that each window now receives the correct label.
Summary by CodeRabbit