summaryrefslogtreecommitdiff
path: root/src/windows.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/windows.py')
-rw-r--r--src/windows.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/windows.py b/src/windows.py
index 85584152..df361ed8 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -126,7 +126,7 @@ class Win(object):
self._win.attron(curses.A_UNDERLINE)
elif attr_char == 'b':
self._win.attron(curses.A_BOLD)
- elif attr_char.isnumeric():
+ elif attr_char in string.digits and attr_char != '':
self._win.attron(common.curses_color_pair(int(attr_char)))
next_attr_char = text.find('\x19')
self.addstr(text)
@@ -566,7 +566,11 @@ class TextWin(Win):
else:
txt = txt.replace('\t', ' ')
# length of the time
- offset = 9+len(theme.CHAR_TIME_LEFT[:1])+len(theme.CHAR_TIME_RIGHT[:1])
+ offset = 9
+ if theme.CHAR_TIME_RIGHT:
+ offset += 1
+ if theme.CHAR_TIME_RIGHT:
+ offset += 1
nickname = message.nickname
if nickname and len(nickname) >= 25:
nick = nickname[:25]+'…'
@@ -1125,7 +1129,7 @@ class MessageInput(Input):
Read one more char (c) and add \x19c to the string
"""
attr_char = self.core.read_keyboard()
- if attr_char in self.text_attributes or (attr_char.isnumeric() and int(attr_char) < 7):
+ if attr_char in self.text_attributes or (attr_char in string.digits and int(attr_char) < 7):
self.do_command('\x19', False)
self.do_command(attr_char)