]> granicus.if.org Git - vim/commitdiff
patch 8.1.2324: with of scrollbar in popup menu not taken into account v8.1.2324
authorBram Moolenaar <Bram@vim.org>
Thu, 21 Nov 2019 11:12:35 +0000 (12:12 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 21 Nov 2019 11:12:35 +0000 (12:12 +0100)
Problem:    With of scrollbar in popup menu not taken into account.
Solution:   Add the width of the scrollbar.

src/popupmenu.c
src/testdir/dumps/Test_popupwin_infopopup_6.dump [new file with mode: 0644]
src/testdir/test_popupwin.vim
src/version.c

index 55845cf2d9635755b1316f11e47368c1a1340062..10d367a3b201d94bbf746c2597e234cf9ee4ed20 100644 (file)
@@ -628,7 +628,7 @@ pum_redraw(void)
     void
 pum_position_info_popup(win_T *wp)
 {
-    int col = pum_col + pum_width + 1;
+    int col = pum_col + pum_width + pum_scrollbar + 1;
     int row = pum_row;
     int botpos = POPPOS_BOTLEFT;
 
@@ -745,7 +745,7 @@ pum_set_selected(int n, int repeat UNUSED)
 #if defined(FEAT_QUICKFIX)
        /*
         * Show extra info in the preview window if there is something and
-        * 'completeopt' contains "preview" or "popup".
+        * 'completeopt' contains "preview" or "popup" or "popuphidden".
         * Skip this when tried twice already.
         * Skip this also when there is not much room.
         * NOTE: Be very careful not to sync undo!
diff --git a/src/testdir/dumps/Test_popupwin_infopopup_6.dump b/src/testdir/dumps/Test_popupwin_infopopup_6.dump
new file mode 100644 (file)
index 0000000..18ed96b
--- /dev/null
@@ -0,0 +1,14 @@
+|a+0&#ffffff0|w|o|r|d> @17|╔+0&#ffff4012|═@15|X| +0&#ffffff0@33
+|w+0#0000001#e0e0e08|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| @1| +0#0000000#0000001|║+0&#ffff4012| |w|o|r|d|s| |a|r|e| |c|o@1|l| |║| +0#4040ff13#ffffff0@33
+|a+0#0000001#ffd7ff255|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| @1| +0#0000000#0000001|╚+0&#ffff4012|═@15|⇲| +0#4040ff13#ffffff0@33
+|n+0#0000001#ffd7ff255|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| @1| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@51
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|-+2#0000000&@1| |U|s|e|r| |d|e|f|i|n|e|d| |c|o|m|p|l|e|t|i|o|n| |(|^|U|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |4| +0#0000000&@26
index 041d834652d11145c7b064b9a25371c3b15702b4..8ca7f1c574f009dd5b850f136ce6da74144e4477 100644 (file)
@@ -2896,6 +2896,12 @@ func Test_popupmenu_info_border()
   call term_sendkeys(buf, "\<C-N>\<C-N>")
   call VerifyScreenDump(buf, 'Test_popupwin_infopopup_5', {})
 
+  " Test that the popupmenu's scrollbar and infopopup do not overlap
+  call term_sendkeys(buf, "\<Esc>")
+  call term_sendkeys(buf, ":set pumheight=3\<CR>")
+  call term_sendkeys(buf, "cc\<C-X>\<C-U>")
+  call VerifyScreenDump(buf, 'Test_popupwin_infopopup_6', {})
+
   call StopVimInTerminal(buf)
   call delete('XtestInfoPopup')
 endfunc
index 4b5d180909445f8dcb790b3017e783398cc18b4e..0d8d597b3ada97274af93ece350e57ddd187c141 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2324,
 /**/
     2323,
 /**/