diff options
| author | Eli Zaretskii | 2013-10-11 17:42:05 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2013-10-11 17:42:05 +0300 |
| commit | 052bac0bf1f4a61fbd3dec494de60955f60071e2 (patch) | |
| tree | 5abe4756d62a2662fe5d95671696d7d20b8b82ff /src | |
| parent | e1f9f9e3d8abc2ce9ce9cb7fc89222ca6e3f3baa (diff) | |
| download | emacs-052bac0bf1f4a61fbd3dec494de60955f60071e2.tar.gz emacs-052bac0bf1f4a61fbd3dec494de60955f60071e2.zip | |
Menu item selection on TTYs is now cyclical.
src/term.c (read_menu_input): Make selection of menu items
cyclical. Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
(tty_menu_activate): Fix off-by-one error when computing max_y.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/term.c | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3d92420e7cd..a11737a31c9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-10-11 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * term.c (read_menu_input): Make selection of menu items | ||
| 4 | cyclical. Suggested by Dmitry Antipov <dmantipov@yandex.ru>. | ||
| 5 | (tty_menu_activate): Fix off-by-one error when computing max_y. | ||
| 6 | |||
| 1 | 2013-10-11 Teodor Zlatanov <tzz@lifelogs.com> | 7 | 2013-10-11 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 8 | ||
| 3 | * gnutls.c (gnutls_audit_log_function): Add function for GnuTLS | 9 | * gnutls.c (gnutls_audit_log_function): Add function for GnuTLS |
diff --git a/src/term.c b/src/term.c index 27471775d03..71263d41dd2 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -3177,11 +3177,15 @@ read_menu_input (struct frame *sf, int *x, int *y, int min_y, int max_y, | |||
| 3177 | { | 3177 | { |
| 3178 | if (*y < max_y) | 3178 | if (*y < max_y) |
| 3179 | *y += 1; | 3179 | *y += 1; |
| 3180 | else | ||
| 3181 | *y = min_y; | ||
| 3180 | } | 3182 | } |
| 3181 | else if (EQ (cmd, Qtty_menu_prev_item)) | 3183 | else if (EQ (cmd, Qtty_menu_prev_item)) |
| 3182 | { | 3184 | { |
| 3183 | if (*y > min_y) | 3185 | if (*y > min_y) |
| 3184 | *y -= 1; | 3186 | *y -= 1; |
| 3187 | else | ||
| 3188 | *y = max_y; | ||
| 3185 | } | 3189 | } |
| 3186 | else if (EQ (cmd, Qtty_menu_select)) | 3190 | else if (EQ (cmd, Qtty_menu_select)) |
| 3187 | st = 1; | 3191 | st = 1; |
| @@ -3290,7 +3294,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx, | |||
| 3290 | { | 3294 | { |
| 3291 | int input_status; | 3295 | int input_status; |
| 3292 | int min_y = state[0].y; | 3296 | int min_y = state[0].y; |
| 3293 | int max_y = min (min_y + state[0].menu->count, FRAME_LINES (sf)) - 1; | 3297 | int max_y = min (min_y + state[0].menu->count, FRAME_LINES (sf) - 1) - 1; |
| 3294 | 3298 | ||
| 3295 | input_status = read_menu_input (sf, &x, &y, min_y, max_y, &first_time); | 3299 | input_status = read_menu_input (sf, &x, &y, min_y, max_y, &first_time); |
| 3296 | if (input_status) | 3300 | if (input_status) |