fix: Improve status bar rendering and commit message display
This commit is contained in:
parent
a804ebe85a
commit
c2c678b8b3
18
gtm
18
gtm
|
|
@ -883,10 +883,11 @@ def draw_status_bars(stdscr, state):
|
|||
# Use terminal's default colors for the status bar
|
||||
status_attr = curses.A_NORMAL # Use terminal's default colors
|
||||
|
||||
# Fill the top status bar with spaces using reverse video
|
||||
# Fill all status bar lines with spaces using reverse video
|
||||
for y in range(state.status_bar_height):
|
||||
for x in range(state.width - 1):
|
||||
try:
|
||||
stdscr.addch(status_bar_start, x, ' ', curses.A_REVERSE)
|
||||
stdscr.addch(state.height - state.status_bar_height + y, x, ' ', curses.A_REVERSE)
|
||||
except curses.error:
|
||||
pass
|
||||
|
||||
|
|
@ -931,14 +932,6 @@ def draw_status_bars(stdscr, state):
|
|||
# --- Second status bar (bottom) ---
|
||||
# Draw the commit details in the second status bar
|
||||
|
||||
# Fill all status bar lines with spaces using reverse video
|
||||
for y in range(state.status_bar_height):
|
||||
for x in range(state.width - 1):
|
||||
try:
|
||||
stdscr.addch(state.height - state.status_bar_height + y, x, ' ', curses.A_REVERSE)
|
||||
except curses.error:
|
||||
pass
|
||||
|
||||
# Draw the commit hash and message on the left
|
||||
if state.commit_hash:
|
||||
commit_info = f" {state.commit_hash} "
|
||||
|
|
@ -956,11 +949,10 @@ def draw_status_bars(stdscr, state):
|
|||
message_lines = [""]
|
||||
|
||||
# Calculate how many message lines we can display
|
||||
# We need at least one line for the status bar with hash and author
|
||||
available_message_lines = state.status_bar_height - 1
|
||||
|
||||
try:
|
||||
# Draw the commit hash with bold on the bottom line of the status bar
|
||||
# Always draw the commit hash and first line of message on the bottom line
|
||||
bottom_line = state.height - 1
|
||||
stdscr.addstr(bottom_line, 0, commit_info, curses.A_REVERSE | curses.A_BOLD)
|
||||
|
||||
|
|
@ -982,7 +974,7 @@ def draw_status_bars(stdscr, state):
|
|||
line_available_width = state.width - 4 # Leave some margin
|
||||
if len(line) > line_available_width:
|
||||
line = line[:line_available_width-3] + "..."
|
||||
# Draw the line with some indentation
|
||||
# Draw the line with some indentation (going upward from the bottom line)
|
||||
line_y = bottom_line - i
|
||||
stdscr.addstr(line_y, 4, line, curses.A_REVERSE)
|
||||
except curses.error:
|
||||
|
|
|
|||
Loading…
Reference in New Issue