-
Notifications
You must be signed in to change notification settings - Fork 783
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
Improves-snap-ergonomics #1578
base: main
Are you sure you want to change the base?
Improves-snap-ergonomics #1578
Conversation
There are two kinds of valid layouts: - layouts that are pairs - layout that are trios While there maybe layout arrangements that are greater than twos and threes, it's difficult to say the number of applications required to trigger those layouts.
- now if you say 'snap clock' twice in a row it will rotate the focused window
for more information, see https://pre-commit.ci
- If you say 'snap first split' it will split without changing the order - If you say 'snap third clock' will swap the third window with the first, so you can repeat to swap them back
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
- This requires a little bit more manual finesse than the previous version but it does allow you to snap specific applications and leave others alone. If you say, 'snap clock code', for example, it won't affect anything but the code windows. You can say, 'snap clock code all' to effect windows after code by appending all other windows after the code windows. If you say, 'snap clock' alone it will continue to rotate the windows as before.
for more information, see https://pre-commit.ci
- There might be a better approach, but this will at least try to snap all windows specified. (ran into an unresizable window in zoom)
- If a snap error happens, it will continue trying to snap - Struggled to maintain rotate behavior, but it seems to be working presently
…t instead of the left
- Next need to reset this variable when focus is done by other means
- Calling focus has a delay so, we have to wait until the function is done before we can be sure that we can start listening for events again
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.
From the community backlog session: we had a few specific comments on your implementation but are not sure the complexity of this implementation it's something we want to have in community.
@nriley I see that you marked this as a draft - I'm not planning to change any more unless I get feedback to do so. Is it ok to mark it ready for review now? |
Sure! We just wanted to separate it out during our review session as it was still being worked on. |
Thanks! I heard from @phillco that I do still have some feedback coming so I'll wait until we meet to discuss. |
- There was a concern that some people might want to rename these position names - This allows for renaming them in one location without breaking the other functionality
|
||
ctx = Context() | ||
|
||
ctx.lists["user.window_split_positions"] = SPLIT_POSITIONS.keys() |
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.
Move this to the top right after defining it on the module
else: | ||
target_length = len(filter_nonviable_windows(ui.windows())) | ||
if number_small is not None: | ||
return SPLIT_POSITIONS[window_split_positions][number_small] |
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.
Let's copy this here
- sometimes filters windows that should not be filter
- It doesn't work as effectively as just skipping when the snap fails
This implements a few changes: