From c060ba06cd315ebc84e43e71abf22a99c36b0fb7 Mon Sep 17 00:00:00 2001 From: "n loewen (aider)" Date: Sun, 8 Jun 2025 00:02:07 +0100 Subject: [PATCH] feat: Highlight spaces before and after scroll percentage in status bar --- gtm2.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gtm2.py b/gtm2.py index 0900ae8..bd8a13a 100755 --- a/gtm2.py +++ b/gtm2.py @@ -392,15 +392,16 @@ def draw_status_bars(stdscr, state): try: # Use reverse video if left pane is active left_attr = status_attr | curses.A_REVERSE if state.focus == "left" else status_attr - stdscr.addstr(state.height - 1, 1, left_status, left_attr) + # Add a space before and after the percentage with the same highlighting + stdscr.addstr(state.height - 1, 0, f" {left_status} ", left_attr) except curses.error: pass # Add commit message in the middle if commit_message: # Calculate available space - left_margin = len(left_status) + 3 if state.show_sidebar else 1 - right_margin = len(right_status) + 3 # Add more space before right percentage + left_margin = len(left_status) + 5 if state.show_sidebar else 1 # +5 for the spaces around percentage + right_margin = len(right_status) + 5 # +5 for the spaces around percentage available_width = state.width - left_margin - right_margin # Truncate message if needed @@ -417,11 +418,13 @@ def draw_status_bars(stdscr, state): # Add right percentage indicator with highlighting for active pane try: - right_x = state.width - len(right_status) - 3 # More space before percentage + # Include spaces in the highlighted area + padded_right_status = f" {right_status} " + right_x = state.width - len(padded_right_status) if right_x >= 0: # Use reverse video if right pane is active right_attr = status_attr | curses.A_REVERSE if state.focus == "right" else status_attr - stdscr.addstr(state.height - 1, right_x, right_status, right_attr) + stdscr.addstr(state.height - 1, right_x, padded_right_status, right_attr) except curses.error: pass