]>
Commit | Line | Data |
---|---|---|
7bf01cab ER |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.1.149 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.1.149 | |
11 | Problem: GTK GUI: When the completion popup menu is used scrolling another | |
12 | window by the scrollbar is OK, but using the scroll wheel it | |
13 | behaves line <Enter>. | |
14 | Solution: Ignore K_MOUSEDOWN and K_MOUSEUP. Fix redrawing the popup menu. | |
15 | Files: src/edit.c, src/gui.c | |
16 | ||
17 | ||
18 | *** ../vim-7.1.148/src/edit.c Fri Oct 19 20:39:56 2007 | |
19 | --- src/edit.c Sun Nov 4 16:17:42 2007 | |
20 | *************** | |
21 | *** 3385,3392 **** | |
22 | if (c != Ctrl_R && vim_is_ctrl_x_key(c)) | |
23 | edit_submode_extra = NULL; | |
24 | ||
25 | ! /* Ignore end of Select mode mapping */ | |
26 | ! if (c == K_SELECT) | |
27 | return retval; | |
28 | ||
29 | /* Set "compl_get_longest" when finding the first matches. */ | |
30 | --- 3385,3392 ---- | |
31 | if (c != Ctrl_R && vim_is_ctrl_x_key(c)) | |
32 | edit_submode_extra = NULL; | |
33 | ||
34 | ! /* Ignore end of Select mode mapping and mouse scroll buttons. */ | |
35 | ! if (c == K_SELECT || c == K_MOUSEDOWN || c == K_MOUSEUP) | |
36 | return retval; | |
37 | ||
38 | /* Set "compl_get_longest" when finding the first matches. */ | |
39 | *************** | |
40 | *** 8652,8666 **** | |
41 | int up; | |
42 | { | |
43 | pos_T tpos; | |
44 | ! # if defined(FEAT_GUI) && defined(FEAT_WINDOWS) | |
45 | ! win_T *old_curwin; | |
46 | # endif | |
47 | ||
48 | tpos = curwin->w_cursor; | |
49 | ||
50 | # if defined(FEAT_GUI) && defined(FEAT_WINDOWS) | |
51 | - old_curwin = curwin; | |
52 | - | |
53 | /* Currently the mouse coordinates are only known in the GUI. */ | |
54 | if (gui.in_use && mouse_row >= 0 && mouse_col >= 0) | |
55 | { | |
56 | --- 8652,8667 ---- | |
57 | int up; | |
58 | { | |
59 | pos_T tpos; | |
60 | ! # if defined(FEAT_WINDOWS) | |
61 | ! win_T *old_curwin = curwin; | |
62 | ! # endif | |
63 | ! # ifdef FEAT_INS_EXPAND | |
64 | ! int did_scroll = FALSE; | |
65 | # endif | |
66 | ||
67 | tpos = curwin->w_cursor; | |
68 | ||
69 | # if defined(FEAT_GUI) && defined(FEAT_WINDOWS) | |
70 | /* Currently the mouse coordinates are only known in the GUI. */ | |
71 | if (gui.in_use && mouse_row >= 0 && mouse_col >= 0) | |
72 | { | |
73 | *************** | |
74 | *** 8677,8692 **** | |
75 | # endif | |
76 | undisplay_dollar(); | |
77 | ||
78 | ! if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL)) | |
79 | ! scroll_redraw(up, (long)(curwin->w_botline - curwin->w_topline)); | |
80 | ! else | |
81 | ! scroll_redraw(up, 3L); | |
82 | ||
83 | # if defined(FEAT_GUI) && defined(FEAT_WINDOWS) | |
84 | curwin->w_redr_status = TRUE; | |
85 | ||
86 | curwin = old_curwin; | |
87 | curbuf = curwin->w_buffer; | |
88 | # endif | |
89 | ||
90 | if (!equalpos(curwin->w_cursor, tpos)) | |
91 | --- 8678,8717 ---- | |
92 | # endif | |
93 | undisplay_dollar(); | |
94 | ||
95 | ! # ifdef FEAT_INS_EXPAND | |
96 | ! /* Don't scroll the window in which completion is being done. */ | |
97 | ! if (!pum_visible() | |
98 | ! # if defined(FEAT_WINDOWS) | |
99 | ! || curwin != old_curwin | |
100 | ! # endif | |
101 | ! ) | |
102 | ! # endif | |
103 | ! { | |
104 | ! if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL)) | |
105 | ! scroll_redraw(up, (long)(curwin->w_botline - curwin->w_topline)); | |
106 | ! else | |
107 | ! scroll_redraw(up, 3L); | |
108 | ! # ifdef FEAT_INS_EXPAND | |
109 | ! did_scroll = TRUE; | |
110 | ! # endif | |
111 | ! } | |
112 | ||
113 | # if defined(FEAT_GUI) && defined(FEAT_WINDOWS) | |
114 | curwin->w_redr_status = TRUE; | |
115 | ||
116 | curwin = old_curwin; | |
117 | curbuf = curwin->w_buffer; | |
118 | + # endif | |
119 | + | |
120 | + # ifdef FEAT_INS_EXPAND | |
121 | + /* The popup menu may overlay the window, need to redraw it. | |
122 | + * TODO: Would be more efficient to only redraw the windows that are | |
123 | + * overlapped by the popup menu. */ | |
124 | + if (pum_visible() && did_scroll) | |
125 | + { | |
126 | + redraw_all_later(NOT_VALID); | |
127 | + ins_compl_show_pum(); | |
128 | + } | |
129 | # endif | |
130 | ||
131 | if (!equalpos(curwin->w_cursor, tpos)) | |
132 | *** ../vim-7.1.148/src/gui.c Wed Sep 5 21:45:54 2007 | |
133 | --- src/gui.c Fri Oct 19 16:14:57 2007 | |
134 | *************** | |
135 | *** 4214,4220 **** | |
136 | #endif | |
137 | ) | |
138 | { | |
139 | ! redraw_win_later(wp, VALID); | |
140 | updateWindow(wp); /* update window, status line, and cmdline */ | |
141 | } | |
142 | ||
143 | --- 4214,4232 ---- | |
144 | #endif | |
145 | ) | |
146 | { | |
147 | ! int type = VALID; | |
148 | ! | |
149 | ! #ifdef FEAT_INS_EXPAND | |
150 | ! if (pum_visible()) | |
151 | ! { | |
152 | ! type = NOT_VALID; | |
153 | ! wp->w_lines_valid = 0; | |
154 | ! } | |
155 | ! #endif | |
156 | ! /* Don't set must_redraw here, it may cause the popup menu to | |
157 | ! * disappear when losing focus after a scrollbar drag. */ | |
158 | ! if (wp->w_redr_type < type) | |
159 | ! wp->w_redr_type = type; | |
160 | updateWindow(wp); /* update window, status line, and cmdline */ | |
161 | } | |
162 | ||
163 | *** ../vim-7.1.148/src/version.c Sun Nov 4 15:35:23 2007 | |
164 | --- src/version.c Tue Nov 6 22:21:03 2007 | |
165 | *************** | |
166 | *** 668,669 **** | |
167 | --- 668,671 ---- | |
168 | { /* Add new patch number below this line */ | |
169 | + /**/ | |
170 | + 149, | |
171 | /**/ | |
172 | ||
173 | -- | |
174 | From "know your smileys": | |
175 | ...---... SOS | |
176 | ||
177 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
178 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
179 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
180 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |