]> granicus.if.org Git - vim/commitdiff
patch 8.0.1522: popup menu is positioned in the wrong place v8.0.1522
authorBram Moolenaar <Bram@vim.org>
Sat, 17 Feb 2018 19:35:29 +0000 (20:35 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 17 Feb 2018 19:35:29 +0000 (20:35 +0100)
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)

src/popupmnu.c
src/version.c

index 2839ea1997f96015fcba84a1695e35ff318391c2..dfdcca072e5de801b84fb764ae5123a3b4f9062d 100644 (file)
@@ -252,26 +252,30 @@ pum_display(
            {
                /* align right pum edge with "col" */
 #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;
                    if (pum_col >= Columns)
                        pum_col = Columns - 1;
                }
-               else
+               else if (!curwin->w_p_rl)
 #endif
                {
-                   pum_col = col - max_width - pum_scrollbar;
-                   if (pum_col < 0)
-                       pum_col = 0;
+                   if (col > Columns - max_width - pum_scrollbar)
+                   {
+                       pum_col = Columns - max_width - pum_scrollbar;
+                       if (pum_col < 0)
+                           pum_col = 0;
+                   }
                }
 
 #ifdef FEAT_RIGHTLEFT
                if (curwin->w_p_rl)
-                   pum_width = W_ENDCOL(curwin) - pum_col - pum_scrollbar + 1;
+                   pum_width = pum_col - pum_scrollbar + 1;
                else
 #endif
-                   pum_width = pum_col - pum_scrollbar;
+                   pum_width = Columns - pum_col - pum_scrollbar;
 
                if (pum_width < p_pw)
                {
index 405e3b58dc7dfa3ae3a9b3ac19e814cebafabaef..14b419076fbf046dfe7db57d23d63ffe3ed60f75 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1522,
 /**/
     1521,
 /**/