0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.2720: GTK menu tooltip moves the cursor

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.
This commit is contained in:
Bram Moolenaar
2021-04-05 18:20:45 +02:00
parent e42939af87
commit 01ac0a1f66
2 changed files with 8 additions and 0 deletions

View File

@@ -691,17 +691,23 @@ menu_item_select(GtkWidget *widget UNUSED, gpointer data)
char_u *tooltip; char_u *tooltip;
static int did_msg = FALSE; static int did_msg = FALSE;
if (State & CMDLINE)
return;
menu = (vimmenu_T *)data; menu = (vimmenu_T *)data;
tooltip = CONVERT_TO_UTF8(menu->strings[MENU_INDEX_TIP]); tooltip = CONVERT_TO_UTF8(menu->strings[MENU_INDEX_TIP]);
if (tooltip != NULL && utf_valid_string(tooltip, NULL)) if (tooltip != NULL && utf_valid_string(tooltip, NULL))
{ {
msg((char *)tooltip); msg((char *)tooltip);
did_msg = TRUE; did_msg = TRUE;
setcursor();
out_flush_cursor(TRUE, FALSE);
} }
else if (did_msg) else if (did_msg)
{ {
msg(""); msg("");
did_msg = FALSE; did_msg = FALSE;
setcursor();
out_flush_cursor(TRUE, FALSE);
} }
CONVERT_TO_UTF8_FREE(tooltip); CONVERT_TO_UTF8_FREE(tooltip);
} }

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2720,
/**/ /**/
2719, 2719,
/**/ /**/