Skip to content

Commit d68e818

Browse files
gobenjimichal42
authored andcommitted
nconf: add u, d command keys in scroll windows
They function just like they do in less(1). Also correct some discrepancy between the help text and the code wrt function keys. Signed-off-by: Benjamin Poirier <bpoirier@suse.de> Signed-off-by: Michal Marek <mmarek@suse.cz>
1 parent 9d4792c commit d68e818

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

scripts/kconfig/nconf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ static const char nconf_readme[] = N_(
8383
"Text Box (Help Window)\n"
8484
"--------\n"
8585
"o Use the cursor keys to scroll up/down/left/right. The VI editor\n"
86-
" keys h,j,k,l function here as do <SPACE BAR> for those\n"
87-
" who are familiar with less and lynx.\n"
86+
" keys h,j,k,l function here as do <u>, <d> and <SPACE BAR> for\n"
87+
" those who are familiar with less and lynx.\n"
8888
"\n"
89-
"o Press <Enter>, <F1>, <F5>, <F7> or <Esc> to exit.\n"
89+
"o Press <Enter>, <F1>, <F5>, <F9>, <q> or <Esc> to exit.\n"
9090
"\n"
9191
"\n"
9292
"Alternate Configuration Files\n"

scripts/kconfig/nconf.gui.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,11 @@ void show_scroll_win(WINDOW *main_window,
604604
switch (res) {
605605
case KEY_NPAGE:
606606
case ' ':
607+
case 'd':
607608
start_y += text_lines-2;
608609
break;
609610
case KEY_PPAGE:
611+
case 'u':
610612
start_y -= text_lines+2;
611613
break;
612614
case KEY_HOME:
@@ -632,10 +634,10 @@ void show_scroll_win(WINDOW *main_window,
632634
start_x++;
633635
break;
634636
}
635-
if (res == 10 || res == 27 || res == 'q'
636-
|| res == KEY_F(F_BACK) || res == KEY_F(F_EXIT)) {
637+
if (res == 10 || res == 27 || res == 'q' ||
638+
res == KEY_F(F_HELP) || res == KEY_F(F_BACK) ||
639+
res == KEY_F(F_EXIT))
637640
break;
638-
}
639641
if (start_y < 0)
640642
start_y = 0;
641643
if (start_y >= total_lines-text_lines)

0 commit comments

Comments
 (0)