diff --git a/gtm b/gtm index b01137d..b1c8314 100755 --- a/gtm +++ b/gtm @@ -554,7 +554,8 @@ def draw_right_pane(stdscr, state): state.right_scroll_offset = min(state.right_scroll_offset, max_scroll) # Get visible lines based on the calculated visible height - visible_lines = state.file_lines[state.right_scroll_offset:state.right_scroll_offset + visible_height] + # Add +1 to ensure we can see the last line + visible_lines = state.file_lines[state.right_scroll_offset:state.right_scroll_offset + visible_height + 1] display_lines = [] deleted_line_map = {} @@ -582,7 +583,7 @@ def draw_right_pane(stdscr, state): display_row = 0 for line_info in display_lines: - if display_row >= state.height - 2: + if display_row >= state.height - state.status_bar_height: break line_type = line_info['type'] @@ -879,7 +880,10 @@ def draw_help_popup(stdscr, state): def draw_status_bar_background(stdscr, layout: StatusBarLayout): """Fill the entire status bar area with reverse video background""" - for y in range(layout.start_y, layout.start_y + layout.total_height): + # Make sure we don't try to draw beyond the screen + end_y = min(layout.start_y + layout.total_height, layout.screen_width) + + for y in range(layout.start_y, end_y): try: # Fill the entire line with spaces in reverse video # This is more efficient than adding characters one by one