From 63bbecbbc396cea554f18610864629e9267c5631 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sun, 14 Oct 2018 01:42:51 +0200 Subject: menuconfig: Fix crash when pressing Ctrl-F with no matches in jump-to dialog Ctrl-F is the jump-to dialog view-help shortcut. It needs to check whether there are any matches, like Enter/jump-to does. --- menuconfig.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/menuconfig.py b/menuconfig.py index 238c367..7b71637 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -1941,13 +1941,14 @@ def _jump_to_dialog(): sel_node_i, scroll) elif c == "\x06": # \x06 = Ctrl-F - _safe_curs_set(0) - _info_dialog(matches[sel_node_i], True) - _safe_curs_set(1) + if matches: + _safe_curs_set(0) + _info_dialog(matches[sel_node_i], True) + _safe_curs_set(1) - scroll = _resize_jump_to_dialog( - edit_box, matches_win, bot_sep_win, help_win, - sel_node_i, scroll) + scroll = _resize_jump_to_dialog( + edit_box, matches_win, bot_sep_win, help_win, + sel_node_i, scroll) elif c == curses.KEY_DOWN: select_next_match() -- cgit v1.2.3