Mercurial > vim
comparison src/gui_gtk.c @ 24359:db86c2b0d5c6 v8.2.2720
patch 8.2.2720: GTK menu tooltip moves the cursor
Commit: https://github.com/vim/vim/commit/01ac0a1f664c5b1ffd5c9ef196d4b47edf2fd494
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Apr 5 18:20:45 2021 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 05 Apr 2021 18:30:04 +0200 |
parents | c80daba2b5df |
children | 7342df6f02bb |
comparison
equal
deleted
inserted
replaced
24358:33c9ef35e406 | 24359:db86c2b0d5c6 |
---|---|
689 { | 689 { |
690 vimmenu_T *menu; | 690 vimmenu_T *menu; |
691 char_u *tooltip; | 691 char_u *tooltip; |
692 static int did_msg = FALSE; | 692 static int did_msg = FALSE; |
693 | 693 |
694 if (State & CMDLINE) | |
695 return; | |
694 menu = (vimmenu_T *)data; | 696 menu = (vimmenu_T *)data; |
695 tooltip = CONVERT_TO_UTF8(menu->strings[MENU_INDEX_TIP]); | 697 tooltip = CONVERT_TO_UTF8(menu->strings[MENU_INDEX_TIP]); |
696 if (tooltip != NULL && utf_valid_string(tooltip, NULL)) | 698 if (tooltip != NULL && utf_valid_string(tooltip, NULL)) |
697 { | 699 { |
698 msg((char *)tooltip); | 700 msg((char *)tooltip); |
699 did_msg = TRUE; | 701 did_msg = TRUE; |
702 setcursor(); | |
703 out_flush_cursor(TRUE, FALSE); | |
700 } | 704 } |
701 else if (did_msg) | 705 else if (did_msg) |
702 { | 706 { |
703 msg(""); | 707 msg(""); |
704 did_msg = FALSE; | 708 did_msg = FALSE; |
709 setcursor(); | |
710 out_flush_cursor(TRUE, FALSE); | |
705 } | 711 } |
706 CONVERT_TO_UTF8_FREE(tooltip); | 712 CONVERT_TO_UTF8_FREE(tooltip); |
707 } | 713 } |
708 | 714 |
709 void | 715 void |