mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user