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>
This commit is contained in:
Benjamin Poirier
2012-07-24 16:12:03 -04:00
committed by Michal Marek
parent 9d4792c9b4
commit d68e818bc4
2 changed files with 8 additions and 6 deletions

View File

@@ -604,9 +604,11 @@ void show_scroll_win(WINDOW *main_window,
switch (res) {
case KEY_NPAGE:
case ' ':
case 'd':
start_y += text_lines-2;
break;
case KEY_PPAGE:
case 'u':
start_y -= text_lines+2;
break;
case KEY_HOME:
@@ -632,10 +634,10 @@ void show_scroll_win(WINDOW *main_window,
start_x++;
break;
}
if (res == 10 || res == 27 || res == 'q'
|| res == KEY_F(F_BACK) || res == KEY_F(F_EXIT)) {
if (res == 10 || res == 27 || res == 'q' ||
res == KEY_F(F_HELP) || res == KEY_F(F_BACK) ||
res == KEY_F(F_EXIT))
break;
}
if (start_y < 0)
start_y = 0;
if (start_y >= total_lines-text_lines)