fix: Ensure initial commit content is loaded safely when commits exist
This commit is contained in:
parent
e36d158cb4
commit
a8ac9c1e85
6
gtm
6
gtm
|
|
@ -296,6 +296,10 @@ def load_commit_content(state: AppState) -> AppState:
|
|||
if not commit_details['message'].strip():
|
||||
commit_details['message'] = short_message
|
||||
|
||||
# Ensure we have some commit message to display
|
||||
if not commit_details['message']:
|
||||
commit_details['message'] = short_message if short_message else "No commit message"
|
||||
|
||||
max_scroll_new = max(0, len(file_lines) - (state.height - state.status_bar_height))
|
||||
right_scroll_offset = state.right_scroll_offset
|
||||
if reference_line:
|
||||
|
|
@ -1381,6 +1385,8 @@ def main(stdscr, filename, show_diff, show_add, show_del, mouse, wrap_lines=True
|
|||
except Exception:
|
||||
pass
|
||||
|
||||
# Load initial commit content so commit details are available immediately
|
||||
if state.commits:
|
||||
state = load_commit_content(state)
|
||||
|
||||
# Initial draw before the main loop starts
|
||||
|
|
|
|||
Loading…
Reference in New Issue