From ed75b6fd376321d2f50f9c1243084562d68307ac Mon Sep 17 00:00:00 2001 From: "n loewen (aider)" Date: Sun, 8 Jun 2025 01:51:25 +0100 Subject: [PATCH] fix: Implement no-wrap functionality for line display --- gtm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gtm b/gtm index 15d88f2..d813085 100755 --- a/gtm +++ b/gtm @@ -293,14 +293,20 @@ def draw_right_pane(stdscr, state): available_width = right_width - len(prefix) # Handle line wrapping - if len(content) <= available_width: - # Line fits, no wrapping needed + if len(content) <= available_width or not state.wrap_lines: + # Line fits or wrapping is disabled if prefix: stdscr.addstr(display_row, right_start, prefix, attr) - stdscr.addnstr(display_row, content_start, content, available_width, attr) + + # If wrapping is disabled, just show what fits in the available width + display_content = content + if not state.wrap_lines and len(content) > available_width: + display_content = content[:available_width] + + stdscr.addnstr(display_row, content_start, display_content, available_width, attr) display_row += 1 else: - # Line needs wrapping + # Line needs wrapping and wrapping is enabled remaining = content first_line = True