]> git.eshelyaron.com Git - emacs.git/commitdiff
src/term.c (tty_menu_activate): A better initialization for cursor coordinates.
authorEli Zaretskii <eliz@gnu.org>
Thu, 1 May 2014 15:59:42 +0000 (18:59 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 1 May 2014 15:59:42 +0000 (18:59 +0300)
src/ChangeLog
src/term.c

index 859149396084e8798548537c0a69f0f26c1c03f0..17a32a4823f08a8dba6e10d0c60f7232543eea86 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-01  Eli Zaretskii  <eliz@gnu.org>
+
+       * term.c (tty_menu_activate): A better initialization for cursor
+       coordinates.
+
 2014-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * intervals.c: Tighten assertions.
index 3bbb21f15895fea020aa17e3deab255038c736ec..12cd2ce8508ea183969840068b5065a46c52c80d 100644 (file)
@@ -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;