From 9a7c2c2136e8f928c218456d432b5d367f2c1aa0 Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 11 Oct 2017 23:34:32 +0200 Subject: Fix #3338 (cycle tabs with /w foo instead of picking the first) --- poezio/core/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/poezio/core/commands.py b/poezio/core/commands.py index 7b4d0c10..31e6d8a1 100644 --- a/poezio/core/commands.py +++ b/poezio/core/commands.py @@ -210,7 +210,10 @@ class CommandCore: self.core.current_tab_nb = number else: matchs = [] - for tab in self.core.tabs: + target_tabs = self.core.tabs[self.core.current_tab_nb+1:] + if not target_tabs: + target_tabs = self.core.tabs + for tab in target_tabs: for tab_name in tab.matching_names(): if tab_name[1] and name in tab_name[1].lower(): matchs.append((tab_name[0], tab)) -- cgit v1.2.3