patch 8.2.2568: second time a preview popup is opened highlight is not set
Problem: Second time a preview popup is opened highlight is not set.
(Gabriel Dupras)
Solution: Apply 'previewpopup' after getting the file. (closes #7928)
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index f1a4b52..f13252b 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -3159,6 +3159,7 @@
\ 'this is another word',
\ 'very long line where the word is also another'])
set previewpopup=height:4,width:40
+ hi OtherColor ctermbg=lightcyan guibg=lightcyan
set path=.
END
call writefile(lines, 'XtestPreviewPopup')
@@ -3168,6 +3169,7 @@
call term_sendkeys(buf, ":\<CR>")
call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_1', {})
+ call term_sendkeys(buf, ":set previewpopup+=highlight:OtherColor\<CR>")
call term_sendkeys(buf, "/another\<CR>\<C-W>}")
call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_2', {})
@@ -3182,6 +3184,7 @@
call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_5', {})
call term_sendkeys(buf, ":silent cd testdir\<CR>")
+ call term_sendkeys(buf, ":set previewpopup-=highlight:OtherColor\<CR>")
call term_sendkeys(buf, ":pclose\<CR>")
call term_sendkeys(buf, ":\<BS>")
call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_6', {})