From b810bdaf3c7ea436b78cb81fca4a1c5e1ff5079f Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 7 Nov 2018 06:38:26 +0100 Subject: 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. --- menuconfig.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'menuconfig.py') 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: -- cgit v1.2.3