From cb088c51d40cb21858cd3ed5f58cac408168f362 Mon Sep 17 00:00:00 2001 From: Russell Schmidt Date: Mon, 20 Jan 2025 09:34:21 -0600 Subject: [PATCH] Count total lines of messages --- ui/curses_ui.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/curses_ui.py b/ui/curses_ui.py index be5b2a7..b9e73b8 100644 --- a/ui/curses_ui.py +++ b/ui/curses_ui.py @@ -93,11 +93,14 @@ def draw_messages_window(): if channel in globals.all_messages: messages = globals.all_messages[channel] + msg_lines = 0 + # Display messages starting from the calculated start index row = 0 for (prefix, message) in messages: full_message = f"{prefix}{message}" wrapped_lines = textwrap.wrap(full_message, messages_box.getmaxyx()[1] - 2) + msg_lines += len(wrapped_lines) for line in wrapped_lines: # Highlight the row if it's the selected message @@ -134,7 +137,6 @@ def draw_node_list(): nodes_win.box() nodes_win.refresh() - def select_channels(direction): channel_list_length = len(globals.channel_list) globals.selected_channel += direction