fix: Left-align commit message in status bar instead of centering
This commit is contained in:
parent
4053001591
commit
43fa1dc529
5
gtm2.py
5
gtm2.py
|
|
@ -405,15 +405,14 @@ def draw_status_bars(stdscr, state):
|
||||||
except curses.error:
|
except curses.error:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Add commit message centered in the commit message bar
|
# Add commit message in the commit message bar
|
||||||
if commit_message:
|
if commit_message:
|
||||||
max_msg_width = state.width - 4 # Leave a small margin
|
max_msg_width = state.width - 4 # Leave a small margin
|
||||||
if len(commit_message) > max_msg_width:
|
if len(commit_message) > max_msg_width:
|
||||||
commit_message = commit_message[:max_msg_width-3] + "..."
|
commit_message = commit_message[:max_msg_width-3] + "..."
|
||||||
|
|
||||||
msg_x = (state.width - len(commit_message)) // 2
|
|
||||||
try:
|
try:
|
||||||
stdscr.addstr(state.height - 1, msg_x, commit_message, status_attr)
|
stdscr.addstr(state.height - 1, 0, commit_message, status_attr)
|
||||||
except curses.error:
|
except curses.error:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue