summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-04-27 02:17:00 +0200
committermathieui <mathieui@mathieui.net>2014-04-27 02:17:00 +0200
commit60224bb76a08d5332e1d0bca810cf9682d45aa89 (patch)
tree8521d75ce67cd1df2423016243417b7f2625f9e8 /src
parent3cb2c8351acba0bd81641f2c281fd7e70f74a365 (diff)
downloadpoezio-60224bb76a08d5332e1d0bca810cf9682d45aa89.tar.gz
poezio-60224bb76a08d5332e1d0bca810cf9682d45aa89.tar.bz2
poezio-60224bb76a08d5332e1d0bca810cf9682d45aa89.tar.xz
poezio-60224bb76a08d5332e1d0bca810cf9682d45aa89.zip
Fix weird behavior while using the input in the muclisttab
Diffstat (limited to 'src')
-rw-r--r--src/tabs/muclisttab.py4
-rw-r--r--src/windows.py16
2 files changed, 12 insertions, 8 deletions
diff --git a/src/tabs/muclisttab.py b/src/tabs/muclisttab.py
index b82f4a23..6506d4cf 100644
--- a/src/tabs/muclisttab.py
+++ b/src/tabs/muclisttab.py
@@ -178,8 +178,10 @@ class MucListTab(Tab):
def on_input(self, key, raw):
res = self.input.do_command(key, raw=raw)
- if res:
+ if res and not isinstance(self.input, windows.Input):
return True
+ elif res:
+ return False
if not raw and key in self.key_func:
return self.key_func[key]()
diff --git a/src/windows.py b/src/windows.py
index 3b45aae1..4dd0c242 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -1240,7 +1240,7 @@ class Input(Win):
Move the cursor one word to the left
"""
if self.pos == 0:
- return
+ return True
separators = string.punctuation+' '
while self.pos > 0 and self.text[self.pos-1] in separators:
self.key_left()
@@ -1253,7 +1253,7 @@ class Input(Win):
Move the cursor one word to the right
"""
if self.is_cursor_at_end():
- return False
+ return True
separators = string.punctuation+' '
while not self.is_cursor_at_end() and self.text[self.pos] in separators:
self.key_right()
@@ -1299,7 +1299,7 @@ class Input(Win):
Cut the text from cursor to the begining of line
"""
if self.pos == 0:
- return
+ return True
Input.clipboard = self.text[:self.pos]
self.text = self.text[self.pos:]
self.key_home()
@@ -1310,7 +1310,7 @@ class Input(Win):
Insert what is in the clipboard at the cursor position
"""
if not Input.clipboard:
- return
+ return True
for letter in Input.clipboard:
self.do_command(letter, False)
self.rewrite_text()
@@ -1322,7 +1322,7 @@ class Input(Win):
"""
self.reset_completion()
if self.is_cursor_at_end():
- return # end of line, nothing to delete
+ return True # end of line, nothing to delete
self.text = self.text[:self.pos]+self.text[self.pos+1:]
self.rewrite_text()
return True
@@ -1354,7 +1354,7 @@ class Input(Win):
if reset:
self.reset_completion()
if self.pos == 0:
- return
+ return True
self.pos -= 1
if reset:
self.rewrite_text()
@@ -1367,7 +1367,7 @@ class Input(Win):
if reset:
self.reset_completion()
if self.is_cursor_at_end():
- return
+ return True
self.pos += 1
if reset:
self.rewrite_text()
@@ -1753,6 +1753,7 @@ class HistoryInput(Input):
self.histo_pos += 1
self.text = self.history[self.histo_pos]
self.key_end()
+ return True
def key_down(self):
"""
@@ -1769,6 +1770,7 @@ class HistoryInput(Input):
self.text = ''
self.histo_pos = -1
self.key_end()
+ return True
class MessageInput(HistoryInput):
"""