summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-06-22 20:02:11 +0200
committermathieui <mathieui@mathieui.net>2013-06-22 20:02:11 +0200
commit6a5423d5f5a2973d9f06c457d4dd1970c539ec81 (patch)
treee58d049ced36e9207d5dd842e4f49bbb0f3e46bb /src/core.py
parent6c046fe16165d9a2161c5b12edf70be76df8c25b (diff)
downloadpoezio-6a5423d5f5a2973d9f06c457d4dd1970c539ec81.tar.gz
poezio-6a5423d5f5a2973d9f06c457d4dd1970c539ec81.tar.bz2
poezio-6a5423d5f5a2973d9f06c457d4dd1970c539ec81.tar.xz
poezio-6a5423d5f5a2973d9f06c457d4dd1970c539ec81.zip
Fix #2294 (fix /w priority)
Now each different match has a different priority. It might need some tuning to have the desired result.
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py8
1 files changed, 7 insertions, 1 deletions
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()