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

Support for clockwise/counterclockwise navigation #248

Open
patrikkj opened this issue May 30, 2024 · 5 comments
Open

Support for clockwise/counterclockwise navigation #248

patrikkj opened this issue May 30, 2024 · 5 comments
Labels
good-first-issue Good for newcomers

Comments

@patrikkj
Copy link

patrikkj commented May 30, 2024

Thank you for building a great tool!

One thing that I've missed is the ability to focus, move and join-with using clockwise/counterclockwise navigation, akin to mod1 + j, mod1 + k etc. in Amethyst. Alternative names could be next/previous.

Features:

  • allows for movements using one/two directional keys instead of four
  • requires significantly fewer actions in certain cases
  • is unambiguous, as in its behaviour does not change based on the focus cache.

Example:

h_tiles
├── window_1 (focused)
└── v_tiles
    ├── window_2 (prev. focused)
    └── window_3

navigating to window_3 in this case requires two actions, right which would take you to window_2 followed by down. This could have been done using a single ccw action.

@nikitabobko
Copy link
Owner

How should more complicated layouts work in this case?

h_tiles
  window1
  v_tiles
    window2
    window3
  window4

@patrikkj
Copy link
Author

patrikkj commented May 31, 2024

I think an angle-based heuristic could make sense:
image

Regular in-order tree traversal using next and previous could also go a long way, eg. win1 -> win2 -> win3 -> win4 in your example.

@nffdiogosilva
Copy link

I would also like to have this feature :)

@codemac
Copy link

codemac commented Jun 7, 2024

Would love this option as well. In many cases I have 2, maybe 3 windows.

The complex layout options is when hjkl works better, but for 90% of the time I basically want "some other" window of which is either one or two windows.

@nikitabobko
Copy link
Owner

Given AeroSpace tree nature, a more well-defined algorithm would be to add possibility to focus next/prev window in DFS (Depth-first search) order

For simple layouts, it will work exactly as clockwise/counterclockwise

But it's yet unclear how to make it work with move and join-with commands (maybe it's not needed)

Though next-dfs/prev-dfs works good with upcoming swap command #8

@nikitabobko nikitabobko added the good-first-issue Good for newcomers label Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants