mirror of
https://github.com/paul-nameless/tg
synced 2024-11-26 05:40:17 +00:00
Tail long msgs
This commit is contained in:
parent
500b5734ac
commit
0443598c5f
1 changed files with 10 additions and 0 deletions
10
tg/views.py
10
tg/views.py
|
@ -359,6 +359,16 @@ class MsgView:
|
||||||
|
|
||||||
line_num -= needed_lines
|
line_num -= needed_lines
|
||||||
if line_num <= 0:
|
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
|
break
|
||||||
collected_items.append((elements, is_selected_msg, line_num))
|
collected_items.append((elements, is_selected_msg, line_num))
|
||||||
if is_selected_msg:
|
if is_selected_msg:
|
||||||
|
|
Loading…
Reference in a new issue