0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

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)
This commit is contained in:
Bram Moolenaar
2018-02-17 20:35:29 +01:00
parent 73cddfd559
commit 4287ed33dd
2 changed files with 13 additions and 7 deletions

View File

@@ -252,26 +252,30 @@ pum_display(
{ {
/* align right pum edge with "col" */ /* align right pum edge with "col" */
#ifdef FEAT_RIGHTLEFT #ifdef FEAT_RIGHTLEFT
if (curwin->w_p_rl) if (curwin->w_p_rl
&& col < max_width + pum_scrollbar + 1)
{ {
pum_col = col + max_width + pum_scrollbar + 1; pum_col = col + max_width + pum_scrollbar + 1;
if (pum_col >= Columns) if (pum_col >= Columns)
pum_col = Columns - 1; pum_col = Columns - 1;
} }
else else if (!curwin->w_p_rl)
#endif #endif
{ {
pum_col = col - max_width - pum_scrollbar; if (col > Columns - max_width - pum_scrollbar)
if (pum_col < 0) {
pum_col = 0; pum_col = Columns - max_width - pum_scrollbar;
if (pum_col < 0)
pum_col = 0;
}
} }
#ifdef FEAT_RIGHTLEFT #ifdef FEAT_RIGHTLEFT
if (curwin->w_p_rl) if (curwin->w_p_rl)
pum_width = W_ENDCOL(curwin) - pum_col - pum_scrollbar + 1; pum_width = pum_col - pum_scrollbar + 1;
else else
#endif #endif
pum_width = pum_col - pum_scrollbar; pum_width = Columns - pum_col - pum_scrollbar;
if (pum_width < p_pw) if (pum_width < p_pw)
{ {

View File

@@ -771,6 +771,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1522,
/**/ /**/
1521, 1521,
/**/ /**/