]> granicus.if.org Git - vim/commitdiff
patch 8.2.2720: GTK menu tooltip moves the cursor v8.2.2720
authorBram Moolenaar <Bram@vim.org>
Mon, 5 Apr 2021 16:20:45 +0000 (18:20 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 5 Apr 2021 16:20:45 +0000 (18:20 +0200)
Problem:    GTK menu tooltip moves the cursor.
Solution:   Position the cursor after displaying the tooltip.  Do not show the
            tooltip when editing the command line.

src/gui_gtk.c
src/version.c

index 3c435f9609367d201d7bc151568d387f1dfda6b5..77076fcbeb6282ec49a1197a64055bf6102cf7ac 100644 (file)
@@ -691,17 +691,23 @@ menu_item_select(GtkWidget *widget UNUSED, gpointer data)
     char_u     *tooltip;
     static int did_msg = FALSE;
 
+    if (State & CMDLINE)
+       return;
     menu = (vimmenu_T *)data;
     tooltip = CONVERT_TO_UTF8(menu->strings[MENU_INDEX_TIP]);
     if (tooltip != NULL && utf_valid_string(tooltip, NULL))
     {
        msg((char *)tooltip);
        did_msg = TRUE;
+       setcursor();
+       out_flush_cursor(TRUE, FALSE);
     }
     else if (did_msg)
     {
        msg("");
        did_msg = FALSE;
+       setcursor();
+       out_flush_cursor(TRUE, FALSE);
     }
     CONVERT_TO_UTF8_FREE(tooltip);
 }
index 76da319622eea310640c05d5c3ce2c4aeb3c87d8..358ff07fe80f44b9c9923f2da4b79ff2a61b6437 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2720,
 /**/
     2719,
 /**/