From 6df2b1bb9b8de472a1cab0369b9d195479bdb4ad Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Thu, 2 Jan 2025 10:58:14 +0000 Subject: [PATCH] Simplify --- src/Widgets/TerminalView.vala | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Widgets/TerminalView.vala b/src/Widgets/TerminalView.vala index e9e8c3be22..348f47f6a4 100644 --- a/src/Widgets/TerminalView.vala +++ b/src/Widgets/TerminalView.vala @@ -168,11 +168,7 @@ public class Terminal.TerminalView : Gtk.Box { public void cycle_tabs (Hdy.NavigationDirection direction) { var pos = tab_view.get_page_position (selected_page); pos = direction == FORWARD ? pos + 1 : pos - 1; - if (pos == n_pages) { - pos = 0; - } else if (pos < 0) { - pos = (int) n_pages - 1; - } + pos = (pos + n_pages) % n_pages; selected_page = tab_view.get_nth_page (pos); }