summaryrefslogtreecommitdiff
path: root/poezio/core
diff options
context:
space:
mode:
Diffstat (limited to 'poezio/core')
-rw-r--r--poezio/core/commands.py5
-rw-r--r--poezio/core/core.py2
-rw-r--r--poezio/core/handlers.py1
3 files changed, 4 insertions, 4 deletions
diff --git a/poezio/core/commands.py b/poezio/core/commands.py
index d44a401e..838e08fa 100644
--- a/poezio/core/commands.py
+++ b/poezio/core/commands.py
@@ -7,7 +7,6 @@ import logging
log = logging.getLogger(__name__)
import os
-from datetime import datetime
from xml.etree import cElementTree as ET
from slixmpp.xmlstream.stanzabase import StanzaBase
@@ -198,6 +197,7 @@ class CommandCore:
number = int(name)
except ValueError:
number = -1
+ name = name.lower()
if number != -1 and self.core.current_tab_nb == number:
return
prev_nb = self.core.previous_tab_nb
@@ -212,9 +212,10 @@ class CommandCore:
matchs = []
for tab in self.core.tabs:
for tab_name in tab.matching_names():
- if tab_name[1] and name.lower() in tab_name[1].lower():
+ if tab_name[1] and name in tab_name[1].lower():
matchs.append((tab_name[0], tab))
if not matchs:
+ self.core.previous_tab_nb = prev_nb
return
tab = min(matchs, key=lambda m: m[0])[1]
self.core.current_tab_nb = tab.nb
diff --git a/poezio/core/core.py b/poezio/core/core.py
index d14130c6..35d50b65 100644
--- a/poezio/core/core.py
+++ b/poezio/core/core.py
@@ -1136,7 +1136,7 @@ class Core(object):
"""
def read_next_digit(digit):
try:
- nb = int(digit)
+ int(digit)
except ValueError:
# If it is not a number, we do nothing. If it was the first
# one, we do not wait for a second one by re-setting the
diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py
index 62fc0731..e79e4232 100644
--- a/poezio/core/handlers.py
+++ b/poezio/core/handlers.py
@@ -23,7 +23,6 @@ from poezio import common
from poezio import fixes
from poezio import pep
from poezio import tabs
-from poezio import windows
from poezio import xhtml
from poezio import multiuserchat as muc
from poezio.common import safeJID