summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-01-17 12:17:37 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-01-17 12:17:37 +0100
commit61548724447eccedc43b100657db8c7dcf97f9f7 (patch)
tree20d927f657808b4ff728dd4006797d9a356da185 /src
parentb199669384d9f96f2ec72f34823b650f73433297 (diff)
downloadpoezio-61548724447eccedc43b100657db8c7dcf97f9f7.tar.gz
poezio-61548724447eccedc43b100657db8c7dcf97f9f7.tar.bz2
poezio-61548724447eccedc43b100657db8c7dcf97f9f7.tar.xz
poezio-61548724447eccedc43b100657db8c7dcf97f9f7.zip
/win's arg can be a part of the tab's name
Diffstat (limited to 'src')
-rw-r--r--src/core.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/core.py b/src/core.py
index a3da7e3f..36be6124 100644
--- a/src/core.py
+++ b/src/core.py
@@ -1009,20 +1009,23 @@ class Core(object):
try:
nb = int(args[0])
except ValueError:
- self.command_help('win')
- return
+ nb = arg.strip()
if self.current_tab().nb == nb:
return
self.previous_tab_nb = self.current_tab().nb
self.current_tab().on_lose_focus()
start = self.current_tab()
self.tabs.append(self.tabs.pop(0))
- while self.current_tab().nb != nb:
- self.tabs.append(self.tabs.pop(0))
- if self.current_tab() == start:
- self.current_tab().set_color_state(theme.COLOR_TAB_CURRENT)
- self.refresh_window()
- return
+ if isinstance(nb, int):
+ while self.current_tab().nb != nb:
+ self.tabs.append(self.tabs.pop(0))
+ if self.current_tab() == start:
+ break
+ else:
+ while nb not in JID(self.current_tab().get_name()).user:
+ self.tabs.append(self.tabs.pop(0))
+ if self.current_tab() is start:
+ break
self.current_tab().on_gain_focus()
self.refresh_window()