-
Notifications
You must be signed in to change notification settings - Fork 769
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
When moving to next or prev workspace, don't skip colliding number #4451
base: next
Are you sure you want to change the base?
Conversation
This fixes an issue where, having workspaces: 1, 2:foo, 2:bar, and 3, moving from 2:foo to next moves us to workspace 3, and moving from 2:bar to prev moves us to workspace 1. With this change, moving from 2:foo to next would move us to 2:bar, and from 2:bar to prev would move us to 2:foo.
Closes #4452 |
I just noticed that besides |
Change has been extended to |
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.
Thanks!
Made some nit picks which I think mildly simplify things, otherwise LGTM
src/workspace.c
Outdated
next = child; | ||
goto workspace_next_on_output_end; |
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.
next = child; | |
goto workspace_next_on_output_end; | |
return child; |
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.
Ditto, 19 lines below. This function follows a single-return style. It seems the previous ones were also originally written in such a style.
Personally, I find the assignment clearer. It allows one to visually scan the function source for next =
in order to determine where next
is determined. With this change, one would have to pay a bit more attention that return child
also determines what the next
is. It breaks the overall consistency.
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.
Done. 12bd3f8
src/workspace.c
Outdated
prev = child; | ||
return prev; |
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.
prev = child; | |
return prev; | |
return child; |
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.
Ditto, 24 lines above.
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.
Done. 12bd3f8
src/workspace.c
Outdated
next = child; | ||
return next; |
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.
next = child; | |
return next; | |
return child; |
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.
This was to be consistent with the style used 23 lines above. Should I change that as well?
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.
Yes, please change them. Early returns are preferable.
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.
Done. 12bd3f8
src/workspace.c
Outdated
prev = child; | ||
goto workspace_prev_on_output_end; |
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.
prev = child; | |
goto workspace_prev_on_output_end; | |
return child; |
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.
Ditto, 20 lines below.
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.
Done. 12bd3f8
Also, the release notes need to be updated: https://github.com/i3/i3/blob/next/RELEASE-NOTES-next |
Co-authored-by: Orestis Floros <orestisflo@gmail.com>
I've updated the release notes. |
This fixes an issue where, having workspaces: 1, 2:foo, 2:bar, and 3,
moving from 2:foo to next moves us to workspace 3, and moving from 2:bar
to prev moves us to workspace 1.
With this change, moving from 2:foo to next would move us to 2:bar, and
from 2:bar to prev would move us to 2:foo.
Closes #4452