-
-
Notifications
You must be signed in to change notification settings - Fork 797
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 ghost space left by SplitPane with top_level=true #5969
Open
boazy
wants to merge
1
commit into
wez:main
Choose a base branch
from
boazy:fix/top-level-splits-leave-ghost-space
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for diving in. I'm not sure about this though; if this results in the right outcome, should the above logic to resize be retained?
Can you provide more details on the precise problem scenario, and explain what you meant by the size being remembered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't write this logic, so I wasn't sure about why it exists in the first place. So of course I tried to remove it. But when I removed it completely, something else broke: The new pane text just wrote over the old pane's text without removing it. For instance, If I had a situation like this:
Before Split:
After Split (with
direction=Down, top_level=true
):It was a lot uglier in practice, but that's the basic gist. I'm not 100% what is the underlying issue, but I guess the existing panes' visible area doesn't get redrawn as necessary without calling resize if there is more than one pane.
So the
resize()
call does solve an actual issue. The main problem is that after the new pane you added is closed, the pane(s) that you resized won't refill the area of the closed pane, because the tab size is now smaller than full window size. This is exactly what issue #4984 refers to. Adding this extraresize()
call resizes the tab to the full window size again, but the original (pre-split) panes' contents remain constrained to their new size.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An example of the issue that happens with the current code (without my changes) is provided in #4984 (reproduction of issue).
Due to this bug,
top_level
splits are practically useless. They are not needed to begin with if you just have 1 pane before the split, but if you have more than 1 pane they always leave unusable space behind. I don't think this fix can possibly make anything worse.