-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
add window resizing (second revive of #2704) #14559
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
Open
m4rch3n1ng
wants to merge
15
commits into
helix-editor:master
Choose a base branch
from
m4rch3n1ng:resize-windows
base: master
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
+249
−9
Conversation
This file contains hidden or 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
this currently does nothing anyway and i am unsure about how to do that in this resizing model anyway.
this makes it easier to keep bounds and views in sync and makes it harder to accidentally modify the views without modifying the bounds and vice-versa.
5f988b8
to
dfabfe9
Compare
dfabfe9
to
68f29a8
Compare
Just tried to build from source and played with it a bit, seems to be pretty resilient :
Would love to see this, especially with the new plugin system where we may get more than one windows with file-tree, terminal... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
as #8546 is seemingly stale as well, this is a second attempt at reviving #2704.
while this pr is based on #2704 (and #8546), the resizing model has been changed significantly due to this review comment of the last version, away from a flex-based approach to a percentage and cell-based approach, that resembles the tiling resize model of sway:
internally, each child in a view has an associated
ContainerBounds
, which holds a percentage of how much of the space the content takes up in the parent container. resizing a view modifies the percentages by an even multiple of the percentage, that one cell takes up in the current view, and then resizes the neighboring cells to make space. resizing will resize by an even amount (2 * cx.count()
) of cells, so that both of the sides of the can be resized by an integer amount of cells and doesn't have to deal with 0.5 cells. tracking the sizes in percentages makes it pretty much work-by-default, if the terminal gets resized.the change to take
cx.count()
into account in theresize_view
was made in [f6f601e].due to this change, i was kind of forced to ditch the "focus mode" for windows, as i wasn't sure how to implement this with this (especially being able to toggle it off), so i just left it for now. if you have any idea on how to implement that, let me know and i'll do it.
additionally i also addressed the other two review comments: putting the sticky keybindings into
<space>-w-r
and removing the non-sticky keybindings from the default keymap in [4ad561f] to address this review comment and adjusting the naming in [513e578] to address this review comment.additionally, in a potentially more controversial change in [cb04d2d], i refactored the two independent vecs in
node_bounds
andchildren
into aChildren
struct, where i implemented thepush
,insert
,pop
andremove
functions. this makes it harder to accidentally modify the views without modifying the bounds and vice-versa, but i can very easily revert it again if you prefer.fixes #1176
closes #8546