feat: Highlight spaces before and after scroll percentage in status bar
This commit is contained in:
parent
261dc75b95
commit
c060ba06cd
13
gtm2.py
13
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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue