fix: Implement no-wrap functionality for line display
This commit is contained in:
parent
a39c28c099
commit
ed75b6fd37
14
gtm
14
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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue