fix: Implement no-wrap functionality for line display

This commit is contained in:
n loewen (aider) 2025-06-08 01:51:25 +01:00
parent a39c28c099
commit ed75b6fd37
1 changed files with 10 additions and 4 deletions

14
gtm
View File

@ -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