From 28c05b699f5290d08a55e9342a5f83b41dd20a8f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 1 May 2014 18:59:42 +0300 Subject: [PATCH] src/term.c (tty_menu_activate): A better initialization for cursor coordinates. --- src/ChangeLog | 5 +++++ src/term.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 85914939608..17a32a4823f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-05-01 Eli Zaretskii + + * term.c (tty_menu_activate): A better initialization for cursor + coordinates. + 2014-05-01 Stefan Monnier * intervals.c: Tighten assertions. diff --git a/src/term.c b/src/term.c index 3bbb21f1589..12cd2ce8508 100644 --- a/src/term.c +++ b/src/term.c @@ -3240,7 +3240,10 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx, /* Turn off the cursor. Otherwise it shows through the menu panes, which is ugly. */ + col = cursorX (tty); + row = cursorY (tty); tty_hide_cursor (tty); + if (buffers_num_deleted) menu->text[0][7] = ' '; onepane = menu->count == 1 && menu->submenu[0]; @@ -3378,8 +3381,6 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx, col = cursorX (tty); row = cursorY (tty); } - else - row = -1; /* Display the help-echo message for the currently-selected menu item. */ @@ -3391,8 +3392,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx, /* Move the cursor to the beginning of the current menu item, so that screen readers and other accessibility aids know where the active region is. */ - if (0 <= row) - cursor_to (sf, row, col); + cursor_to (sf, row, col); tty_hide_cursor (tty); fflush (tty->output); prev_menu_help_message = menu_help_message; -- 2.39.5