Skip to content

Conversation

m4rch3n1ng
Copy link
Contributor

@m4rch3n1ng m4rch3n1ng commented Oct 8, 2025

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 the resize_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 and children into a Children struct, where i implemented the push, insert, pop and remove 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

@Ciflire
Copy link
Contributor

Ciflire commented Oct 15, 2025

Just tried to build from source and played with it a bit, seems to be pretty resilient :

  • doesn't break wrapping, it gives up trying to wrap when less than 3-4 cells smth like that
  • doesn't break line numbering
  • Doesn't break inline diagnostics
    Made a little video to showcase this with my config (sry that's the easiest way i found)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resize windows

4 participants