summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 01694c3)
raw | patch | inline | side by side (parent: 01694c3)
author | Jeffrey Middleton <jefromi@gmail.com> | |
Thu, 5 Mar 2009 22:43:04 +0000 (16:43 -0600) | ||
committer | Jeffrey Middleton <jefromi@gmail.com> | |
Thu, 5 Mar 2009 19:15:39 +0000 (13:15 -0600) |
Added commands to scroll up/down half a screen, using the generic functions from the last commit. Mapped by default to B and N, to go along nicely with Ctrl-B and Ctrl-N for single-line scrolling.
src/command.c | patch | blob | history | |
src/command.h | patch | blob | history | |
src/list_window.c | patch | blob | history | |
src/screen_help.c | patch | blob | history |
diff --git a/src/command.c b/src/command.c
index 7182d168689a9eef59c998676bc1eadee4e69ee1..809f449f07be4c0da30e60e5fb3de6626391c8a3 100644 (file)
--- a/src/command.c
+++ b/src/command.c
N_("Scroll up one line") },
{ { 2, 0, 0 }, 0, CMD_LIST_SCROLL_UP_LINE, "scroll-up-line",
N_("Scroll down one line") },
+ { { 'N', 0, 0 }, 0, CMD_LIST_SCROLL_DOWN_HALF, "scroll-down-half",
+ N_("Scroll up half a screen") },
+ { { 'B', 0, 0 }, 0, CMD_LIST_SCROLL_UP_HALF, "scroll-up-half",
+ N_("Scroll down half a screen") },
/* basic screens */
diff --git a/src/command.h b/src/command.h
index abfca4401ab99183bc741db7cf313be75e2985cd..3adc3d2f758e0925511ca1bdbe8f75ea1e5fe2af 100644 (file)
--- a/src/command.h
+++ b/src/command.h
CMD_LIST_VISUAL_SELECT,
CMD_LIST_SCROLL_UP_LINE,
CMD_LIST_SCROLL_DOWN_LINE,
+ CMD_LIST_SCROLL_UP_HALF,
+ CMD_LIST_SCROLL_DOWN_HALF,
CMD_MOUSE_EVENT,
CMD_SCREEN_UPDATE,
CMD_SCREEN_PREVIOUS,
diff --git a/src/list_window.c b/src/list_window.c
index a127a5b07b93bdde85302d638670b488e42c6269..347cfb2d3fdba6b70cb24123e07900541e24648e 100644 (file)
--- a/src/list_window.c
+++ b/src/list_window.c
case CMD_LIST_SCROLL_DOWN_LINE:
list_window_scroll_down(lw, rows, 1);
break;
+ case CMD_LIST_SCROLL_UP_HALF:
+ list_window_scroll_up(lw, (lw->rows - 1) / 2);
+ break;
+ case CMD_LIST_SCROLL_DOWN_HALF:
+ list_window_scroll_down(lw, rows, (lw->rows - 1) / 2);
+ break;
default:
return false;
}
diff --git a/src/screen_help.c b/src/screen_help.c
index e731664f66898f2ae5ecf644b6c4ff7546bddf6a..53b349989c6a15870203b58d35abb92c68d9a5bd 100644 (file)
--- a/src/screen_help.c
+++ b/src/screen_help.c
{ 0, CMD_LIST_VISUAL_SELECT, NULL },
{ 0, CMD_LIST_SCROLL_UP_LINE, NULL},
{ 0, CMD_LIST_SCROLL_DOWN_LINE, NULL},
+ { 0, CMD_LIST_SCROLL_UP_HALF, NULL},
+ { 0, CMD_LIST_SCROLL_DOWN_HALF, NULL},
{ 0, CMD_NONE, NULL },
{ 0, CMD_SCREEN_PREVIOUS,NULL },
{ 0, CMD_SCREEN_NEXT, NULL },