From 3ee31b956ab711ddb8bbb6afbd1b91fa5edee6d0 Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Mon, 15 May 2006 19:57:46 +0000 Subject: [PATCH] Fix wraparound behaviour in switch_to_tab --- src/terminal/tab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/terminal/tab.c b/src/terminal/tab.c index 291c8603..b7283077 100644 --- a/src/terminal/tab.c +++ b/src/terminal/tab.c @@ -139,14 +139,14 @@ switch_to_tab(struct terminal *term, int tab, int tabs) if (tabs > 1) { if (tab >= tabs) { if (get_opt_bool("ui.tabs.wraparound")) - tab = 0; + tab = tab % tabs; else tab = tabs - 1; } if (tab < 0) { if (get_opt_bool("ui.tabs.wraparound")) - tab = tabs - 1; + tab = tabs + tab % tabs; else tab = 0; }