summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-17 20:35:29 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-17 20:35:29 +0100
commit4287ed33ddc324d26dd05d3e19596dd74cf479d6 (patch)
tree460fecb8027d150654188e15d66580b133d9fa48
parent73cddfd559152ea9b7e978ea7cf9c0d3a41e7316 (diff)
patch 8.0.1522: popup menu is positioned in the wrong placev8.0.1522
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)
-rw-r--r--src/popupmnu.c18
-rw-r--r--src/version.c2
2 files changed, 13 insertions, 7 deletions
diff --git a/src/popupmnu.c b/src/popupmnu.c
index 2839ea1997..dfdcca072e 100644
--- a/src/popupmnu.c
+++ b/src/popupmnu.c
@@ -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)
{
diff --git a/src/version.c b/src/version.c
index 405e3b58dc..14b419076f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -772,6 +772,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1522,
+/**/
1521,
/**/
1520,