diff src/testdir/test_popupwin.vim @ 30606:c5356021a938 v9.0.0638

patch 9.0.0638: popup menu highlight wrong on top of preview popup Commit: https://github.com/vim/vim/commit/393f8d61f55cb6127a100e812ba4d66097a32d2e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 2 14:28:30 2022 +0100 patch 9.0.0638: popup menu highlight wrong on top of preview popup Problem: Popup menu highlight wrong on top of preview popup. (Yegappan Lakshmanan) Solution: Also check for the popup menu in screen_line().
author Bram Moolenaar <Bram@vim.org>
date Sun, 02 Oct 2022 15:30:07 +0200
parents 457ea0570b6f
children 360f286b5869
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -3362,6 +3362,45 @@ func Test_previewpopup()
   call StopVimInTerminal(buf)
 endfunc
 
+func Test_previewpopup_pum()
+  CheckScreendump
+  CheckFeature quickfix
+
+  let lines =<< trim END
+      let a = 3
+      let b = 1
+      echo a
+      echo b
+      call system('echo hello')
+      " the end
+  END
+  call writefile(lines, 'XpreviewText.vim', 'D')
+
+  let lines =<< trim END
+      call setline(1, ['one', 'two', 'three', 'other', 'once', 'only', 'off'])
+      set previewpopup=height:6,width:40
+      pedit XpreviewText.vim
+  END
+  call writefile(lines, 'XtestPreviewPum', 'D')
+  let buf = RunVimInTerminal('-S XtestPreviewPum', #{rows: 12})
+
+  call term_sendkeys(buf, "A o\<C-N>")
+  call VerifyScreenDump(buf, 'Test_pum_preview_1', {})
+
+  call term_sendkeys(buf, "\<C-N>")
+  call VerifyScreenDump(buf, 'Test_pum_preview_2', {})
+
+  call term_sendkeys(buf, "\<C-N>")
+  call VerifyScreenDump(buf, 'Test_pum_preview_3', {})
+
+  call term_sendkeys(buf, "\<C-N>")
+  call VerifyScreenDump(buf, 'Test_pum_preview_4', {})
+
+  call term_sendkeys(buf, "\<Esc>")
+  call StopVimInTerminal(buf)
+endfunc
+
+
 func Get_popupmenu_lines()
   let lines =<< trim END
       set completeopt+=preview,popup