Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tab): focus largest pane instead of topmost #3795

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Pyxels
Copy link

@Pyxels Pyxels commented Nov 21, 2024

When multiple Panes have the same x coord in a MoveTabOrFocus event that switches tabs, instead of picking the pane at the top to focus, choose the one biggest one. This ensures that in stacked layouts, the focused pane is opened again when moving, instead of always focusing the top pane.

Current Behaviour

When switching tabs in MoveTabOrFocus, pick the one at the border, if multiple, pick the topmost.

Fixed Behaviour

When switching tabs in MoveTabOrFocus, pick the one at the border, if multiple, pick the largest, then the topmost.

This ensures that when stacked panes are used, the previously focused is once again focused instead of always using the first.

Considerations

This should not influence existing workflows using normal tiled panes all to much, since the previous implementation was quite arbitrary anyway, but is a big fix for stacked layouts, since this "keeps the layout" instead of resetting.

closes #3006

When multiple Panes have the same x coord in a MoveTabOrFocus event that switches tabs, instead of picking the pane at the top to focus, choose the one biggest one. This ensures that in stacked layouts, the focused pane is opened again when moving, instead of always focusing the top pane.

closes zellij-org#3006
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.

Stack pane position not persisting when switching tabs
1 participant