summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-10-14 01:42:51 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-10-14 01:51:01 +0200
commit63bbecbbc396cea554f18610864629e9267c5631 (patch)
treefcff8abe6f49395819d0c78c79e4284db4a77250
parent8a8e03dab76f9c6893b355c5790a63095a0b781d (diff)
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.
-rwxr-xr-xmenuconfig.py13
1 files 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()