diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2024-08-24 08:38:05 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-24 08:38:05 +0800 |
| commit | bb4b6b427c1952b4a9b72f406b913ec59f0d4d22 (patch) | |
| tree | 84a311aaa5ccc422a6963724cbc7684278f3123c /test/old/testdir | |
| parent | 2c6222c56b099603b20b54a51e9acaa7974b1ad4 (diff) | |
| download | rneovim-bb4b6b427c1952b4a9b72f406b913ec59f0d4d22.tar.gz rneovim-bb4b6b427c1952b4a9b72f406b913ec59f0d4d22.tar.bz2 rneovim-bb4b6b427c1952b4a9b72f406b913ec59f0d4d22.zip | |
vim-patch:9.1.0690: cannot set special highlight kind in popupmenu (#30128)
Problem: cannot set special highlight kind in popupmenu
Solution: add kind_hlgroup item to complete function
(glepnir)
closes: vim/vim#15561
https://github.com/vim/vim/commit/38f99a1f0d61e9bde3f4a3d0cbe2d06185c4a57f
Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat (limited to 'test/old/testdir')
| -rw-r--r-- | test/old/testdir/test_popup.vim | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim index 5e234a397b..2a038d7da4 100644 --- a/test/old/testdir/test_popup.vim +++ b/test/old/testdir/test_popup.vim @@ -1550,4 +1550,37 @@ func Test_pum_user_hl_group() call StopVimInTerminal(buf) endfunc +func Test_pum_user_kind_hlgroup() + CheckScreendump + let lines =<< trim END + func CompleteFunc( findstart, base ) + if a:findstart + return 0 + endif + return { + \ 'words': [ + \ { 'word': 'aword1', 'menu': 'extra text 1', 'kind': 'variable', 'kind_hlgroup': 'KindVar', 'hl_group': 'StrikeFake' }, + \ { 'word': 'aword2', 'menu': 'extra text 2', 'kind': 'function', 'kind_hlgroup': 'KindFunc' }, + \ { 'word': '你好', 'menu': 'extra text 3', 'kind': 'class', 'kind_hlgroup': 'KindClass' }, + \]} + endfunc + set completeopt=menu + set completefunc=CompleteFunc + + hi StrikeFake ctermfg=9 + hi KindVar ctermfg=yellow + hi KindFunc ctermfg=blue + hi KindClass ctermfg=green + END + call writefile(lines, 'Xscript', 'D') + let buf = RunVimInTerminal('-S Xscript', {}) + + call TermWait(buf) + call term_sendkeys(buf, "S\<C-X>\<C-U>") + call VerifyScreenDump(buf, 'Test_pum_highlights_16', {}) + call term_sendkeys(buf, "\<C-E>\<Esc>") + + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab |