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

Whenever split horizontal is triggered, window is "pushed" down #96

Closed
Nikki1993 opened this issue Jan 3, 2024 · 4 comments
Closed

Comments

@Nikki1993
Copy link

I am having hard time describing it well so I've recorded a video.

I got 2 keybinds.

cmd-alt-ctrl-h = 'split horizontal'
cmd-alt-ctrl-period = 'split vertical'

Whenever I want to split horizontally window gets pushed. Then I switch back to split vertical and it goes back up. If I trigger split horizontally and then close the window to the right and re-open it again, window gets correctly positioned from top to bottom. If I open another, it also correctly splits horizontally. But if I were to open a new window when the previous one is "pushed" down, the second window will also appear "pushed" down.

Screen.Recording.2024-01-03.at.18.48.51.mov
@fmasa
Copy link

fmasa commented Jan 4, 2024

@Nikki1993 This is because split creates new implicit horizontal container and the window is moved inside.

In default config, there is a indent-for-nested-containers-with-the-same-orientation = 30 which automatically idnets nested containers with the same orientation.

@nikitabobko
Copy link
Owner

nikitabobko commented Jan 4, 2024

I just got an idea that it would make sense to create paddings from all 4 sides for windows that are the only child of their parent container, regardless of the containers orientations

Showing 4 paddings would be a better visualization

Example 1:

h_tiles
  window1
  v_tiles
    window2  <- create all 4 paddings

Example 2

h_tiles
  window1
  h_tiles
    window2  <- create all 4 paddings

And apply indent-for-nested-containers-with-the-same-orientation only in cases when there are several children

Example 3

h_tiles
  window1
  h_tiles      <-- "indent" the container. indent-for-nested-containers-with-the-same-orientation
    window2
    window3

Example 4

h_tiles
  window1
  v_tiles      <-- no indentation
    window2
    window3

@nikitabobko
Copy link
Owner

nikitabobko commented Jan 4, 2024

Idea No. 2

When a window is the only child of its parent then pretend that there is a second child in the container. It would create a "gap" in the tiles. But the gap will make it clear what orientation the parent has.

Given this layout:

h_tiles
  window1
  h_tiles
    window2

It would be rendered as if window2 had a sibling:

h_tiles
  window1
  h_tiles
    window2
    fake_sibling_window

Given this layout:

h_tiles
  window1
  v_tiles
    window2

It still would be rendered as if window2 had a sibling:

h_tiles
  window1
  h_tiles       <-- It's unclear whether the layout should be applied
    window2
    fake_sibling_window

Correct me if I'm wrong, but the only reason why people create containers that have only a single child is to later add another window as a sibling. The empty gap in tiles would make this intention clear

And this idea makes it possible to use split command with enable-normalization-flatten-containers. enable-normalization-flatten-containers could be dropped. Effectively it would always be enabled

@nikitabobko
Copy link
Owner

nikitabobko commented Apr 22, 2024

Breaking change. indent-for-nested-containers-with-the-same-orientation is confusing, so I dropped it in 0.10.0

jakenvac pushed a commit to jakenvac/AeroSpace that referenced this issue Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants