* view.c (check_left_right_keys): Implement fast scrolling if
Ctrl is pressed. Idea by Arpad Biro <biro_arpad@yahoo.com>
Этот коммит содержится в:
родитель
d839fbc15a
Коммит
20b89d5436
@ -1,5 +1,8 @@
|
||||
2003-11-21 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* view.c (check_left_right_keys): Implement fast scrolling if
|
||||
Ctrl is pressed. Idea by Arpad Biro <biro_arpad@yahoo.com>
|
||||
|
||||
* execute.c (do_execute): Use get_key_code(), not getch() to
|
||||
consume all characters from a single sequence.
|
||||
Reported by Miven Dooligan <dooligan@intergate.ca>
|
||||
|
37
src/view.c
37
src/view.c
@ -2249,18 +2249,39 @@ view_labels (WView *view)
|
||||
redraw_labels (h);
|
||||
}
|
||||
|
||||
/* Both views */
|
||||
static int
|
||||
/* Check for left and right arrows, possibly with modifiers */
|
||||
static cb_ret_t
|
||||
check_left_right_keys (WView *view, int c)
|
||||
{
|
||||
if (c == KEY_LEFT)
|
||||
if (c == KEY_LEFT) {
|
||||
move_left (view);
|
||||
else if (c == KEY_RIGHT)
|
||||
move_right (view);
|
||||
else
|
||||
return 0;
|
||||
return MSG_HANDLED;
|
||||
}
|
||||
|
||||
return 1;
|
||||
if (c == KEY_RIGHT) {
|
||||
move_right (view);
|
||||
return MSG_HANDLED;
|
||||
}
|
||||
|
||||
/* Ctrl with arrows moves by 10 postions in the unwrap mode */
|
||||
if (view->hex_mode || view->wrap_mode)
|
||||
return MSG_NOT_HANDLED;
|
||||
|
||||
if (c == (KEY_M_CTRL | KEY_LEFT)) {
|
||||
view->start_col = view->start_col + 10;
|
||||
if (view->start_col > 0)
|
||||
view->start_col = 0;
|
||||
view->dirty++;
|
||||
return MSG_HANDLED;
|
||||
}
|
||||
|
||||
if (c == (KEY_M_CTRL | KEY_RIGHT)) {
|
||||
view->start_col = view->start_col - 10;
|
||||
view->dirty++;
|
||||
return MSG_HANDLED;
|
||||
}
|
||||
|
||||
return MSG_NOT_HANDLED;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user