summaryrefslogtreecommitdiff
path: root/poezio/ui/types.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2019-09-29 12:20:00 +0200
committermathieui <mathieui@mathieui.net>2020-05-09 19:46:17 +0200
commit5bc510eafa5d3e9c735687f0b8c9d446159fffca (patch)
treee00c4b890c0c7e09c32a227b14ae90c0869c6a38 /poezio/ui/types.py
parent32beeca48018422499b9c0af55a5c5b1eaa67d75 (diff)
downloadpoezio-5bc510eafa5d3e9c735687f0b8c9d446159fffca.tar.gz
poezio-5bc510eafa5d3e9c735687f0b8c9d446159fffca.tar.bz2
poezio-5bc510eafa5d3e9c735687f0b8c9d446159fffca.tar.xz
poezio-5bc510eafa5d3e9c735687f0b8c9d446159fffca.zip
Fix an issue in xmllog rendering due to wrong offset
and improve tests to catch that
Diffstat (limited to 'poezio/ui/types.py')
-rw-r--r--poezio/ui/types.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/poezio/ui/types.py b/poezio/ui/types.py
index 18e51427..6c744ac3 100644
--- a/poezio/ui/types.py
+++ b/poezio/ui/types.py
@@ -48,13 +48,12 @@ class XMLLog(BaseMessage):
def compute_offset(self, with_timestamps: bool, nick_size: int) -> int:
offset = 0
theme = get_theme()
- IN, OUT = theme.CHAR_XML_IN, theme.CHAR_XML_OUT
if with_timestamps:
offset += 1 + SHORT_FORMAT_LENGTH
if self.incoming:
- nick = IN
+ nick = theme.CHAR_XML_IN
else:
- nick = OUT
+ nick = theme.CHAR_XML_OUT
nick = truncate_nick(nick, nick_size) or ''
offset += 1 + len(nick)
return offset