retronews

a featureful fork of the luke8086/retronews hn+lobste.rs tui
Log | Files | Refs | README | LICENSE

commit 105aa437306dd5bb3019fe46083b2627a82b720f
parent 5d98261a9cb302b935f6211265a01e6a063bcd76
Author: luke8086 <55237178+luke8086@users.noreply.github.com>
Date:   Mon, 25 Jul 2022 22:11:08 +0000

Hide response titles in the index except for the first row

Diffstat:
Mretronews.py | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/retronews.py b/retronews.py @@ -563,13 +563,16 @@ def app_render_index_row(app: AppState, row: int, message: Message) -> None: cols = app.layout.cols date = message.date.strftime("%Y-%m-%d %H:%M") author = message.author[:10].ljust(10) + is_response = message.title.startswith("Re:") and message.msg_id != message.story_id + title = "" if is_response and row > app.layout.index_start else message.title + unread = ( str(max(min(message.total_comments - message.read_comments, 9999), 0)).rjust(4) if message.msg_id == message.story_id else " " ) - app.screen.insstr(row, 0, f"[{date}] [{author}] [{unread}] {message.index_tree}{message.title}") + app.screen.insstr(row, 0, f"[{date}] [{author}] [{unread}] {message.index_tree}{title}") if message == app.selected_message: app.screen.chgat(row, 0, cols, app.colors.cursor)