fix: Move help_items definition to resolve popup rendering issue
This commit is contained in:
parent
ecce880cdb
commit
26a10c5dbc
52
gtm
52
gtm
|
|
@ -654,6 +654,32 @@ def draw_help_popup(stdscr, state):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
# Define help content
|
||||||
|
help_items = [
|
||||||
|
("Navigation", ""),
|
||||||
|
("j / Down", "Scroll down"),
|
||||||
|
("k / Up", "Scroll up"),
|
||||||
|
("Space / Page Down", "Page down"),
|
||||||
|
("b / Page Up", "Page up"),
|
||||||
|
("h / Left", "Focus left pane"),
|
||||||
|
("l / Right", "Focus right pane"),
|
||||||
|
("", ""),
|
||||||
|
("Features", ""),
|
||||||
|
("/", "Search in file"),
|
||||||
|
("n", "Next search match"),
|
||||||
|
("N", "Previous search match"),
|
||||||
|
("c", "Next change"),
|
||||||
|
("C", "Previous change"),
|
||||||
|
("d", "Toggle diff mode"),
|
||||||
|
("a", "Toggle diff additions"),
|
||||||
|
("x", "Toggle diff deletions"),
|
||||||
|
("s", "Toggle sidebar"),
|
||||||
|
("w", "Toggle line wrapping"),
|
||||||
|
("L", "Toggle line numbers"),
|
||||||
|
("q / Esc", "Quit"),
|
||||||
|
("?", "Show/hide this help")
|
||||||
|
]
|
||||||
|
|
||||||
# Calculate popup dimensions and position
|
# Calculate popup dimensions and position
|
||||||
popup_width = 60
|
popup_width = 60
|
||||||
# Calculate height based on number of help items plus margins
|
# Calculate height based on number of help items plus margins
|
||||||
|
|
@ -702,32 +728,6 @@ def draw_help_popup(stdscr, state):
|
||||||
except curses.error:
|
except curses.error:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Define help content
|
|
||||||
help_items = [
|
|
||||||
("Navigation", ""),
|
|
||||||
("j / Down", "Scroll down"),
|
|
||||||
("k / Up", "Scroll up"),
|
|
||||||
("Space / Page Down", "Page down"),
|
|
||||||
("b / Page Up", "Page up"),
|
|
||||||
("h / Left", "Focus left pane"),
|
|
||||||
("l / Right", "Focus right pane"),
|
|
||||||
("", ""),
|
|
||||||
("Features", ""),
|
|
||||||
("/", "Search in file"),
|
|
||||||
("n", "Next search match"),
|
|
||||||
("N", "Previous search match"),
|
|
||||||
("c", "Next change"),
|
|
||||||
("C", "Previous change"),
|
|
||||||
("d", "Toggle diff mode"),
|
|
||||||
("a", "Toggle diff additions"),
|
|
||||||
("x", "Toggle diff deletions"),
|
|
||||||
("s", "Toggle sidebar"),
|
|
||||||
("w", "Toggle line wrapping"),
|
|
||||||
("L", "Toggle line numbers"),
|
|
||||||
("q / Esc", "Quit"),
|
|
||||||
("?", "Show/hide this help")
|
|
||||||
]
|
|
||||||
|
|
||||||
# Draw help content
|
# Draw help content
|
||||||
for i, (key, desc) in enumerate(help_items):
|
for i, (key, desc) in enumerate(help_items):
|
||||||
y = popup_y + 2 + i
|
y = popup_y + 2 + i
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue