-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Cycle tabs with Ctrl+Tab #836
Conversation
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.
If we remove the unnecessary cast against n_pages
here, we can remove the following places too , excepting the cast against the result of :focus.clamp ()
[ryo@b760m ~/work/tmp/terminal (jeremypw/cycle-tabs =)]$ git grep -n n_pages | grep -F '(int)'
src/MainWindow.vala:485: notebook.selected_page = notebook.tab_view.get_nth_page ((int)notebook.n_pages - 1);
src/MainWindow.vala:718: var tab = notebook.tab_view.get_nth_page ((int)(focus.clamp (0, notebook.n_pages - 1)));
src/MainWindow.vala:727: int pos = (int)notebook.n_pages
[ryo@b760m ~/work/tmp/terminal (jeremypw/cycle-tabs =)]$
Nice use of |
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.
LGTM and works as expected. Thank you for your fix!
Fixes #834
Rather than use the native Hdy.TabView select_next_page () and select_previous_page () functions, which do not cycle, a custom function is used.