aboutsummaryrefslogtreecommitdiff
path: root/test/old
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-06-13 14:08:50 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-06-15 04:47:23 +0800
commitdc4037f612c6f3bbc76890adfa638d48ec238eee (patch)
tree97e79ba5672c7e6190a8379a2f7d1869f48cbf7e /test/old
parentfd950d4998a497cb4258d35af72408105900296a (diff)
downloadrneovim-dc4037f612c6f3bbc76890adfa638d48ec238eee.tar.gz
rneovim-dc4037f612c6f3bbc76890adfa638d48ec238eee.tar.bz2
rneovim-dc4037f612c6f3bbc76890adfa638d48ec238eee.zip
vim-patch:9.1.0476: Cannot see matched text in popup menu
Problem: Cannot see matched text in popup menu Solution: Introduce 2 new highlighting groups: PmenuMatch and PmenuMatchSel (glepnir) closes: vim/vim#14694 https://github.com/vim/vim/commit/40c1c3317d92f8c2adadf744fab72e4458e2a9fa Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat (limited to 'test/old')
-rw-r--r--test/old/testdir/test_popup.vim67
1 files changed, 67 insertions, 0 deletions
diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim
index 5ae2ed5ed5..acebcae1dd 100644
--- a/test/old/testdir/test_popup.vim
+++ b/test/old/testdir/test_popup.vim
@@ -1348,4 +1348,71 @@ func Test_pum_highlights_custom()
call StopVimInTerminal(buf)
endfunc
+" Test match relate highlight group in pmenu
+func Test_pum_highlights_match()
+ CheckScreendump
+ let lines =<< trim END
+ func Omni_test(findstart, base)
+ if a:findstart
+ return col(".")
+ endif
+ return {
+ \ 'words': [
+ \ { 'word': 'foo',},
+ \ { 'word': 'foobar',},
+ \ { 'word': 'fooBaz',},
+ \ { 'word': 'foobala',},
+ \ { 'word': '你好',},
+ \ { 'word': '你好吗',},
+ \ { 'word': '你不好吗',},
+ \ { 'word': '你可好吗',},
+ \]}
+ endfunc
+ set omnifunc=Omni_test
+ set completeopt=menu,noinsert,fuzzy
+ hi PmenuMatchSel ctermfg=6 ctermbg=225
+ hi PmenuMatch ctermfg=4 ctermbg=225
+ END
+ call writefile(lines, 'Xscript', 'D')
+ let buf = RunVimInTerminal('-S Xscript', {})
+ call TermWait(buf)
+ call term_sendkeys(buf, "i\<C-X>\<C-O>")
+ call TermWait(buf, 50)
+ call term_sendkeys(buf, "fo")
+ call TermWait(buf, 50)
+ call VerifyScreenDump(buf, 'Test_pum_highlights_03', {})
+ call term_sendkeys(buf, "\<ESC>S\<C-x>\<C-O>")
+ call TermWait(buf, 50)
+ call term_sendkeys(buf, "你")
+ call TermWait(buf, 50)
+ call VerifyScreenDump(buf, 'Test_pum_highlights_04', {})
+ call term_sendkeys(buf, "吗")
+ call TermWait(buf, 50)
+ call VerifyScreenDump(buf, 'Test_pum_highlights_05', {})
+
+ if has('rightleft')
+ call term_sendkeys(buf, "\<C-E>\<ESC>u:set rightleft\<CR>")
+ call TermWait(buf, 50)
+ call term_sendkeys(buf, "i\<C-X>\<C-O>")
+ call TermWait(buf, 50)
+ call term_sendkeys(buf, "fo")
+ call TermWait(buf, 50)
+ call VerifyScreenDump(buf, 'Test_pum_highlights_06', {})
+ call term_sendkeys(buf, "\<C-E>\<ESC>u:set norightleft\<CR>")
+ call TermWait(buf)
+ endif
+
+ call term_sendkeys(buf, ":set completeopt-=fuzzy\<CR>")
+ call TermWait(buf)
+ call term_sendkeys(buf, "\<ESC>S\<C-x>\<C-O>")
+ call TermWait(buf, 50)
+ call term_sendkeys(buf, "fo")
+ call TermWait(buf, 50)
+ call VerifyScreenDump(buf, 'Test_pum_highlights_07', {})
+
+ call term_sendkeys(buf, "\<C-E>\<Esc>u")
+ call TermWait(buf)
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab