From 6a5423d5f5a2973d9f06c457d4dd1970c539ec81 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 22 Jun 2013 20:02:11 +0200 Subject: Fix #2294 (fix /w priority) Now each different match has a different priority. It might need some tuning to have the desired result. --- src/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/core.py') diff --git a/src/core.py b/src/core.py index c330bbde..f4f355e6 100644 --- a/src/core.py +++ b/src/core.py @@ -1652,10 +1652,16 @@ class Core(object): return self.current_tab_nb = nb else: + matchs = [] for tab in self.tabs: for name in tab.matching_names(): - if nb in name: + if nb.lower() in name[1].lower(): + matchs.append((name[0], tab)) self.current_tab_nb = tab.nb + if not matchs: + return + tab = min(matchs, key=lambda m: m[0])[1] + self.current_tab_nb = tab.nb old_tab.on_lose_focus() self.current_tab().on_gain_focus() self.refresh_window() -- cgit v1.2.3