summaryrefslogtreecommitdiff
path: root/menuconfig.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-11-07 06:38:26 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2018-11-07 06:48:29 +0100
commitb810bdaf3c7ea436b78cb81fca4a1c5e1ff5079f (patch)
tree01f01ecd03a80bc459e05c2f89028d55038dd1d8 /menuconfig.py
parent41c271b8cbe19e45809a0a9d3f5426bc0b664e29 (diff)
menuconfig: Support HOME and END in the jump-to dialog
Oversight. END can be handy for viewing all choices, menus, and comments, which appear at the end. Also support Ctrl-D as an alias for Page Down. Ctrl-U is already used by the edit box (erase to beginning of line). Also change the jump-to dialog title to hint that other things besides symbols can be jumped to.
Diffstat (limited to 'menuconfig.py')
-rwxr-xr-xmenuconfig.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/menuconfig.py b/menuconfig.py
index 271cc1e..027f64f 100755
--- a/menuconfig.py
+++ b/menuconfig.py
@@ -1991,16 +1991,24 @@ def _jump_to_dialog():
elif c == curses.KEY_UP:
select_prev_match()
- elif c == curses.KEY_NPAGE: # Page Down
+ elif c in (curses.KEY_NPAGE, "\x04"): # Page Down/Ctrl-D
# Keep it simple. This way we get sane behavior for small windows,
# etc., for free.
for _ in range(_PG_JUMP):
select_next_match()
- elif c == curses.KEY_PPAGE: # Page Up
+ # Page Up (no Ctrl-U, as it's already used by the edit box)
+ elif c == curses.KEY_PPAGE:
for _ in range(_PG_JUMP):
select_prev_match()
+ elif c == curses.KEY_END:
+ sel_node_i = len(matches) - 1
+ scroll = _max_scroll(matches, matches_win)
+
+ elif c == curses.KEY_HOME:
+ sel_node_i = scroll = 0
+
else:
s, s_i, hscroll = _edit_text(c, s, s_i, hscroll,
edit_box.getmaxyx()[1] - 2)
@@ -2155,7 +2163,7 @@ def _draw_jump_to_dialog(edit_box, matches_win, bot_sep_win, help_win,
edit_box.erase()
- _draw_frame(edit_box, "Jump to symbol")
+ _draw_frame(edit_box, "Jump to symbol/choice/menu/comment")
# Draw arrows pointing up if the symbol list is scrolled down
if scroll > 0: