summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-04-04 02:29:35 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-04-04 02:29:35 +0200
commit22832b339bf1fd5d74fb382fc31b91c41f70bbc5 (patch)
treea53a4d69634a30d4412d979a67ea26e3508ae6fc
parent63e4833b0934c995ac46fc33f02fad7cc652b454 (diff)
downloadpoezio-22832b339bf1fd5d74fb382fc31b91c41f70bbc5.tar.gz
poezio-22832b339bf1fd5d74fb382fc31b91c41f70bbc5.tar.bz2
poezio-22832b339bf1fd5d74fb382fc31b91c41f70bbc5.tar.xz
poezio-22832b339bf1fd5d74fb382fc31b91c41f70bbc5.zip
Fix colors of reason in a kick message
-rw-r--r--src/tabs.py4
-rw-r--r--src/windows.py18
2 files changed, 14 insertions, 8 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 53115716..ac896a8c 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -805,9 +805,9 @@ class MucTab(ChatTab):
if by:
kick_msg = _('\x191%(spec)s \x193%(nick)s\x195 has been banned by \x194%(by)s') % {'spec':theme.CHAR_KICK, 'nick':from_nick, 'by':by}
else:
- kick_msg = _('\x191%(spec)s \x193%(nick)s \x195has been banned') % {'spec':theme.CHAR_KICK, 'nick':from_nick.replace('"', '\\"')}
+ kick_msg = _('\x191%(spec)s \x193%(nick)s\x195 has been banned') % {'spec':theme.CHAR_KICK, 'nick':from_nick.replace('"', '\\"')}
if reason is not None and reason.text:
- kick_msg += _(' Reason: %(\x196reason\x195)s') % {'reason': reason.text}
+ kick_msg += _(' Reason: \x196%(reason\x195)s') % {'reason': reason.text}
room.add_message(kick_msg)
def on_user_kicked(self, room, presence, user, from_nick):
diff --git a/src/windows.py b/src/windows.py
index 48cfc7ba..23e704df 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -815,7 +815,8 @@ class Input(Win):
if not Input.clipboard or len(Input.clipboard) == 0:
return
for letter in Input.clipboard:
- self.do_command(letter)
+ self.do_command(letter, False)
+ self.rewrite_text()
return True
def key_dc(self):
@@ -859,12 +860,14 @@ class Input(Win):
Move the cursor one char to the left
"""
self.reset_completion()
- (y, x) = self._win.getyx()
if self.pos == self.width-1 and self.line_pos > 0:
self.line_pos -= 1
elif self.pos >= 1:
self.pos -= 1
- self.rewrite_text()
+ if self.pos+self.line_pos >= 1 and self.text[self.pos+self.line_pos-1] == '\x19':
+ self.key_left()
+ else:
+ self.rewrite_text()
return True
def key_right(self):
@@ -872,13 +875,15 @@ class Input(Win):
Move the cursor one char to the right
"""
self.reset_completion()
- (y, x) = self._win.getyx()
if self.pos == self.width-1:
if self.line_pos + self.width-1 < len(self.text):
self.line_pos += 1
elif self.pos < len(self.text):
self.pos += 1
- self.rewrite_text()
+ if self.pos+self.line_pos < len(self.text)-1 and self.text[self.pos+self.line_pos] == '\x19':
+ self.key_right()
+ else:
+ self.rewrite_text()
return True
def key_backspace(self, reset=True):
@@ -886,11 +891,12 @@ class Input(Win):
Delete the char just before the cursor
"""
self.reset_completion()
- (y, x) = self._win.getyx()
if self.pos == 0:
return
self.text = self.text[:self.pos+self.line_pos-1]+self.text[self.pos+self.line_pos:]
self.key_left()
+ if self.pos+self.line_pos >= 1 and self.text[self.pos+self.line_pos-1] == '\x19':
+ self.key_backspace()
if reset:
self.rewrite_text()
return True