Tail long msgs

This commit is contained in:
Alexander Zveruk 2020-05-31 00:11:15 +03:00
parent 500b5734ac
commit 0443598c5f

View file

@ -359,6 +359,16 @@ class MsgView:
line_num -= needed_lines
if line_num <= 0:
tail_lines = needed_lines + line_num - 1
# try preview long message that did fit in the screen
if line_num < 0 and tail_lines > 0 and not is_selected_msg:
limit = self.w * tail_lines
tail_chatacters = len(msg) - limit - 3
elements = (
*label_elements,
f" ...{msg[tail_chatacters:]}",
)
collected_items.append((elements, is_selected_msg, 0))
break
collected_items.append((elements, is_selected_msg, line_num))
if is_selected_msg: