summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-04-05 20:51:35 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-04-05 20:51:35 +0200
commitce5d67d8f621a1c42d438a65afbf53dba4c6966b (patch)
treec82eb3fcbada3a89a9b65f10e45b95f23a920003
parentf4c138e444bb5913e3d9a940999949c43dc25825 (diff)
downloadpoezio-ce5d67d8f621a1c42d438a65afbf53dba4c6966b.tar.gz
poezio-ce5d67d8f621a1c42d438a65afbf53dba4c6966b.tar.bz2
poezio-ce5d67d8f621a1c42d438a65afbf53dba4c6966b.tar.xz
poezio-ce5d67d8f621a1c42d438a65afbf53dba4c6966b.zip
Alt+ a number returns to the previous tab if we are already on tab “number”.
Kassdédi mrk
-rw-r--r--src/core.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core.py b/src/core.py
index ce256fe0..47811376 100644
--- a/src/core.py
+++ b/src/core.py
@@ -628,10 +628,13 @@ class Core(object):
if char.startswith('M-') and len(char) == 3:
try:
nb = int(char[2])
- except:
+ except ValueError:
pass
else:
- self.command_win('%s' % nb)
+ if self.current_tab().nb == nb:
+ self.go_to_previous_tab()
+ else:
+ self.command_win('%d' % nb)
# search for keyboard shortcut
if char in list(self.key_func.keys()):
self.key_func[char]()