alias C-b/C-f to scroll page back/forward with b/f Suggested by naddy. Remap 'f'ullscreen to 'F', and blame view key maps 'b' and 'B' to 'c' and 'C', respectively, per stsp's and naddy's suggestion. While here, remove trailing whitespace. ok naddy@
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
diff --git a/tog/tog.1 b/tog/tog.1
index 31dd508..ccc38d4 100644
--- a/tog/tog.1
+++ b/tog/tog.1
@@ -64,7 +64,7 @@ Quit
Quit the view which is in focus.
.It Cm Tab
Switch focus between views.
-.It Cm f
+.It Cm F
Toggle fullscreen mode for a split-screen view.
.Nm
will automatically use split-screen views if the size of the terminal
@@ -114,9 +114,9 @@ Log message moves right on the screen.
Scroll log message field to the rightmost position.
.It Cm 0
Scroll log message field to the leftmost position.
-.It Cm Page-down, Ctrl+f
+.It Cm Page-down, Ctrl+f, f
Move the selection cursor down one page.
-.It Cm Page-up, Ctrl+b
+.It Cm Page-up, Ctrl+b, b
Move the selection cursor up one page.
.It Cm Ctrl+d, d
Move the selection cursor down one half page.
@@ -239,9 +239,9 @@ Diff output moves right on the screen.
Scroll view to the rightmost position.
.It Cm 0
Scroll view left to the start of the line.
-.It Cm Page-down, Space, Ctrl+f
+.It Cm Page-down, Space, Ctrl+f, f
Scroll down one page.
-.It Cm Page-up, Ctrl+b
+.It Cm Page-up, Ctrl+b, b
Scroll up one page.
.It Cm Ctrl+d, d
Scroll down one half page.
@@ -320,9 +320,9 @@ File output moves right on the screen.
Scroll view to the rightmost position.
.It Cm 0
Scroll view left to the start of the line.
-.It Cm Page-down, Space, Ctrl+f
+.It Cm Page-down, Space, Ctrl+f, f
Move the selection cursor down one page.
-.It Cm Page-up, Ctrl+b
+.It Cm Page-up, Ctrl+b, b
Move the selection cursor up one page.
.It Cm Ctrl+d, d
Move the selection cursor down one half page.
@@ -336,7 +336,7 @@ Move the selection cursor to the last line of the file.
Open a
.Cm diff
view for the currently selected line's commit.
-.It Cm b
+.It Cm c
Reload the
.Cm blame
view with the version of the file as found in the currently
@@ -346,7 +346,7 @@ Reload the
.Cm blame
view with the version of the file as found in the parent commit of the
currently selected line's commit.
-.It Cm B
+.It Cm C
Reload the
.Cm blame
view with the previously blamed commit.
@@ -403,9 +403,9 @@ are as follows:
Move the selection cursor down.
.It Cm Up-arrow, k, Ctrl-p
Move the selection cursor up.
-.It Cm Page-down, Ctrl+f
+.It Cm Page-down, Ctrl+f, f
Move the selection cursor down one page.
-.It Cm Page-up, Ctrl+b
+.It Cm Page-up, Ctrl+b, b
Move the selection cursor up one page.
.It Cm Ctrl+d, d
Move the selection cursor down one half page.
@@ -477,9 +477,9 @@ are as follows:
Move the selection cursor down.
.It Cm Up-arrow, k, Ctrl-p
Move the selection cursor up.
-.It Cm Page-down, Ctrl+f
+.It Cm Page-down, Ctrl+f, f
Move the selection cursor down one page.
-.It Cm Page-up, Ctrl+b
+.It Cm Page-up, Ctrl+b, b
Move the selection cursor up one page.
.It Cm Ctrl+d, d
Move the selection cursor down one half page.
diff --git a/tog/tog.c b/tog/tog.c
index b8935d8..d375738 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -965,7 +965,7 @@ view_input(struct tog_view **new, int *done, struct tog_view *view,
case 'Q':
*done = 1;
break;
- case 'f':
+ case 'F':
if (view_is_parent_view(view)) {
if (view->child == NULL)
break;
@@ -2625,6 +2625,7 @@ input_log_view(struct tog_view **new_view, struct tog_view *view, int ch)
/* FALL THROUGH */
case KEY_PPAGE:
case CTRL('b'):
+ case 'b':
if (s->first_displayed_entry == NULL)
break;
if (TAILQ_FIRST(&s->commits.head) == s->first_displayed_entry)
@@ -2677,7 +2678,8 @@ input_log_view(struct tog_view **new_view, struct tog_view *view, int ch)
nscroll /= 2;
/* FALL THROUGH */
case KEY_NPAGE:
- case CTRL('f'): {
+ case CTRL('f'):
+ case 'f': {
struct commit_queue_entry *first;
first = s->first_displayed_entry;
if (first == NULL)
@@ -3187,7 +3189,7 @@ add_matched_line(int *wtotal, const char *line, int wlimit, int col_tab_align,
}
if (width0 + w + width > skipcol)
break;
- w += width;
+ w += width;
i++;
}
/* draw (visible part of) matched token (if scrolled into it) */
@@ -4057,6 +4059,7 @@ input_diff_view(struct tog_view **new_view, struct tog_view *view, int ch)
/* FALL THROUGH */
case KEY_PPAGE:
case CTRL('b'):
+ case 'b':
if (s->first_displayed_line == 1)
break;
i = 0;
@@ -4075,6 +4078,7 @@ input_diff_view(struct tog_view **new_view, struct tog_view *view, int ch)
/* FALL THROUGH */
case KEY_NPAGE:
case CTRL('f'):
+ case 'f':
case ' ':
if (s->eof)
break;
@@ -4999,6 +5003,7 @@ input_blame_view(struct tog_view **new_view, struct tog_view *view, int ch)
/* FALL THROUGH */
case KEY_PPAGE:
case CTRL('b'):
+ case 'b':
if (s->first_displayed_line == 1) {
s->selected_line = MAX(1, s->selected_line - nscroll);
break;
@@ -5019,7 +5024,7 @@ input_blame_view(struct tog_view **new_view, struct tog_view *view, int ch)
s->blame.nlines)
s->first_displayed_line++;
break;
- case 'b':
+ case 'c':
case 'p': {
struct got_object_id *id = NULL;
id = get_selected_commit_id(s->blame.lines, s->blame.nlines,
@@ -5087,7 +5092,7 @@ input_blame_view(struct tog_view **new_view, struct tog_view *view, int ch)
break;
break;
}
- case 'B': {
+ case 'C': {
struct got_object_qid *first;
first = STAILQ_FIRST(&s->blamed_commits);
if (!got_object_id_cmp(&first->id, s->commit_id))
@@ -5157,6 +5162,7 @@ input_blame_view(struct tog_view **new_view, struct tog_view *view, int ch)
/* FALL THROUGH */
case KEY_NPAGE:
case CTRL('f'):
+ case 'f':
case ' ':
if (s->last_displayed_line >= s->blame.nlines &&
s->selected_line >= MIN(s->blame.nlines,
@@ -5961,6 +5967,7 @@ input_tree_view(struct tog_view **new_view, struct tog_view *view, int ch)
/* FALL THROUGH */
case KEY_PPAGE:
case CTRL('b'):
+ case 'b':
if (s->tree == s->root) {
if (got_object_tree_get_first_entry(s->tree) ==
s->first_displayed_entry)
@@ -5990,6 +5997,7 @@ input_tree_view(struct tog_view **new_view, struct tog_view *view, int ch)
/* FALL THROUGH */
case KEY_NPAGE:
case CTRL('f'):
+ case 'f':
if (got_tree_entry_get_next(s->tree, s->last_displayed_entry)
== NULL) {
/* can't scroll any further; move cursor down */
@@ -6838,6 +6846,7 @@ input_ref_view(struct tog_view **new_view, struct tog_view *view, int ch)
/* FALL THROUGH */
case KEY_PPAGE:
case CTRL('b'):
+ case 'b':
if (s->first_displayed_entry == TAILQ_FIRST(&s->refs))
s->selected -= MIN(nscroll, s->selected);
ref_scroll_up(s, MAX(0, nscroll));
@@ -6860,6 +6869,7 @@ input_ref_view(struct tog_view **new_view, struct tog_view *view, int ch)
/* FALL THROUGH */
case KEY_NPAGE:
case CTRL('f'):
+ case 'f':
if (TAILQ_NEXT(s->last_displayed_entry, entry) == NULL) {
/* can't scroll any further; move cursor down */
if (s->selected < s->ndisplayed - 1)