comparison src/popupmnu.c @ 13296:67345bc7fe31 v8.0.1522

patch 8.0.1522: popup menu is positioned in the wrong place commit https://github.com/vim/vim/commit/4287ed33ddc324d26dd05d3e19596dd74cf479d6 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 17 20:35:29 2018 +0100 patch 8.0.1522: popup menu is positioned in the wrong place Problem: Popup menu is positioned in the wrong place. (Davit Samvelyan, Boris Staletic) Solution: Correct computation of the column and the conditions for that. (Hirohito Higashi, closes #2640)
author Christian Brabandt <cb@256bit.org>
date Sat, 17 Feb 2018 20:45:05 +0100
parents ac42c4b11dbc
children 2c639a9a4def
comparison
equal deleted inserted replaced
13295:f865fbf44232 13296:67345bc7fe31
250 #endif 250 #endif
251 )) 251 ))
252 { 252 {
253 /* align right pum edge with "col" */ 253 /* align right pum edge with "col" */
254 #ifdef FEAT_RIGHTLEFT 254 #ifdef FEAT_RIGHTLEFT
255 if (curwin->w_p_rl) 255 if (curwin->w_p_rl
256 && col < max_width + pum_scrollbar + 1)
256 { 257 {
257 pum_col = col + max_width + pum_scrollbar + 1; 258 pum_col = col + max_width + pum_scrollbar + 1;
258 if (pum_col >= Columns) 259 if (pum_col >= Columns)
259 pum_col = Columns - 1; 260 pum_col = Columns - 1;
260 } 261 }
262 else if (!curwin->w_p_rl)
263 #endif
264 {
265 if (col > Columns - max_width - pum_scrollbar)
266 {
267 pum_col = Columns - max_width - pum_scrollbar;
268 if (pum_col < 0)
269 pum_col = 0;
270 }
271 }
272
273 #ifdef FEAT_RIGHTLEFT
274 if (curwin->w_p_rl)
275 pum_width = pum_col - pum_scrollbar + 1;
261 else 276 else
262 #endif 277 #endif
263 { 278 pum_width = Columns - pum_col - pum_scrollbar;
264 pum_col = col - max_width - pum_scrollbar;
265 if (pum_col < 0)
266 pum_col = 0;
267 }
268
269 #ifdef FEAT_RIGHTLEFT
270 if (curwin->w_p_rl)
271 pum_width = W_ENDCOL(curwin) - pum_col - pum_scrollbar + 1;
272 else
273 #endif
274 pum_width = pum_col - pum_scrollbar;
275 279
276 if (pum_width < p_pw) 280 if (pum_width < p_pw)
277 { 281 {
278 pum_width = p_pw; 282 pum_width = p_pw;
279 #ifdef FEAT_RIGHTLEFT 283 #ifdef FEAT_RIGHTLEFT