Mercurial > vim
comparison src/popupmnu.c @ 14095:f452c4aeb837 v8.1.0065
patch 8.1.0065: balloon displayed at the wrong position
commit https://github.com/vim/vim/commit/0e6e179f55b85b9e82e74d3f993928d52f0f4d43
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 17 17:10:59 2018 +0200
patch 8.1.0065: balloon displayed at the wrong position
Problem: Balloon displayed at the wrong position.
Solution: Do not reposition the popup menu at the cursor position.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 17 Jun 2018 17:15:05 +0200 |
parents | ae53a9274f50 |
children | 17a7d9e71ebb |
comparison
equal
deleted
inserted
replaced
14094:cc99f2e4de00 | 14095:f452c4aeb837 |
---|---|
27 static int pum_scrollbar; /* TRUE when scrollbar present */ | 27 static int pum_scrollbar; /* TRUE when scrollbar present */ |
28 | 28 |
29 static int pum_row; /* top row of pum */ | 29 static int pum_row; /* top row of pum */ |
30 static int pum_col; /* left column of pum */ | 30 static int pum_col; /* left column of pum */ |
31 | 31 |
32 static win_T *pum_window = NULL; | |
32 static int pum_win_row; | 33 static int pum_win_row; |
33 static int pum_win_height; | 34 static int pum_win_height; |
34 static int pum_win_col; | 35 static int pum_win_col; |
35 static int pum_win_wcol; | 36 static int pum_win_wcol; |
36 static int pum_win_width; | 37 static int pum_win_width; |
108 validate_cursor_col(); | 109 validate_cursor_col(); |
109 pum_array = NULL; | 110 pum_array = NULL; |
110 | 111 |
111 // Remember the essential parts of the window position and size, so we | 112 // Remember the essential parts of the window position and size, so we |
112 // can decide when to reposition the popup menu. | 113 // can decide when to reposition the popup menu. |
114 pum_window = curwin; | |
113 pum_win_row = curwin->w_wrow + W_WINROW(curwin); | 115 pum_win_row = curwin->w_wrow + W_WINROW(curwin); |
114 pum_win_height = curwin->w_height; | 116 pum_win_height = curwin->w_height; |
115 pum_win_col = curwin->w_wincol; | 117 pum_win_col = curwin->w_wincol; |
116 pum_win_wcol = curwin->w_wcol; | 118 pum_win_wcol = curwin->w_wcol; |
117 pum_win_width = curwin->w_width; | 119 pum_win_width = curwin->w_width; |
844 int selected = pum_selected; | 846 int selected = pum_selected; |
845 | 847 |
846 if (!pum_visible()) | 848 if (!pum_visible()) |
847 return; // nothing to do | 849 return; // nothing to do |
848 | 850 |
849 if (pum_win_row == curwin->w_wrow + W_WINROW(curwin) | 851 if (pum_window != curwin |
850 && pum_win_height == curwin->w_height | 852 || (pum_win_row == curwin->w_wrow + W_WINROW(curwin) |
851 && pum_win_col == curwin->w_wincol | 853 && pum_win_height == curwin->w_height |
852 && pum_win_width == curwin->w_width) | 854 && pum_win_col == curwin->w_wincol |
855 && pum_win_width == curwin->w_width)) | |
853 { | 856 { |
854 // window position didn't change, redraw in the same position | 857 // window position didn't change, redraw in the same position |
855 pum_redraw(); | 858 pum_redraw(); |
856 } | 859 } |
857 else | 860 else |
910 ? min_width : pum_base_width); | 913 ? min_width : pum_base_width); |
911 | 914 |
912 pum_width = Columns - pum_col; | 915 pum_width = Columns - pum_col; |
913 if (pum_width > pum_base_width + 1) | 916 if (pum_width > pum_base_width + 1) |
914 pum_width = pum_base_width + 1; | 917 pum_width = pum_base_width + 1; |
918 | |
919 // Do not redraw at cursor position. | |
920 pum_window = NULL; | |
915 } | 921 } |
916 | 922 |
917 # endif | 923 # endif |
918 | 924 |
919 # if defined(FEAT_BEVAL_TERM) || defined(PROTO) | 925 # if defined(FEAT_BEVAL_TERM) || defined(PROTO) |