From 5bc510eafa5d3e9c735687f0b8c9d446159fffca Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 29 Sep 2019 12:20:00 +0200 Subject: Fix an issue in xmllog rendering due to wrong offset and improve tests to catch that --- poezio/ui/types.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'poezio/ui/types.py') 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 -- cgit v1.2.3