From 63d0f4cec6be76f7ce0818bb23369f378b7695f3 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 11 May 2018 22:56:27 +0200 Subject: menuconfig: Jump-to code nit --- menuconfig.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/menuconfig.py b/menuconfig.py index 097abbb..0a3b542 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -1513,21 +1513,20 @@ def _draw_jump_to_dialog(edit_box, matches_win, bot_sep_win, help_win, matches_win.erase() - if bad_re is not None: - # bad_re holds the error message from the re.error exception on errors - _safe_addstr(matches_win, 0, 0, - "Bad regular expression: " + bad_re) - - elif not matches: - _safe_addstr(matches_win, 0, 0, "No matches") - - else: + if matches: for i in range(scroll, min(scroll + matches_win.getmaxyx()[0], len(matches))): _safe_addstr(matches_win, i - scroll, 0, matches[i][1], _LIST_SEL_STYLE if i == sel_node_i else _LIST_STYLE) + else: + # bad_re holds the error message from the re.error exception on errors + _safe_addstr(matches_win, 0, 0, + "No matches" + if bad_re is None else + "Bad regular expression: " + bad_re) + matches_win.noutrefresh() -- cgit v1.2.3