diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-12-18 08:40:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-18 08:40:23 +0800 |
commit | 51c380238cd23c5e6e050dfb379ae6b30bef032c (patch) | |
tree | 042fb803194c25e9f7aa52ac4400d034efbb3071 /test/functional/ui | |
parent | 0dd933265ff2e64786fd30f949e767e10f401519 (diff) | |
parent | b7da54aa9e72a0c7684546439f078ed89ba16d0a (diff) | |
download | rneovim-51c380238cd23c5e6e050dfb379ae6b30bef032c.tar.gz rneovim-51c380238cd23c5e6e050dfb379ae6b30bef032c.tar.bz2 rneovim-51c380238cd23c5e6e050dfb379ae6b30bef032c.zip |
Merge pull request #31615 from zeertzjq/vim-9.1.0936
vim-patch:9.1.{0936,0941,0942}: ComplMatchIns highlight
Diffstat (limited to 'test/functional/ui')
-rw-r--r-- | test/functional/ui/popupmenu_spec.lua | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index beb3ae385c..a64fc99f26 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -5561,6 +5561,71 @@ describe('builtin popupmenu', function() ]]) feed('<C-E><ESC>') end) + + -- oldtest: Test_pum_matchins_highlight() + it('with ComplMatchIns highlight', function() + exec([[ + func Omni_test(findstart, base) + if a:findstart + return col(".") + endif + return [#{word: "foo"}, #{word: "bar"}, #{word: "你好"}] + endfunc + set omnifunc=Omni_test + hi ComplMatchIns guifg=red + ]]) + + feed('Sαβγ <C-X><C-O>') + screen:expect([[ + αβγ {8:foo}^ | + {1:~ }{s: foo }{1: }| + {1:~ }{n: bar }{1: }| + {1:~ }{n: 你好 }{1: }| + {1:~ }|*15 + {2:-- }{5:match 1 of 3} | + ]]) + feed('<C-E><Esc>') + + feed('Sαβγ <C-X><C-O><C-N>') + screen:expect([[ + αβγ {8:bar}^ | + {1:~ }{n: foo }{1: }| + {1:~ }{s: bar }{1: }| + {1:~ }{n: 你好 }{1: }| + {1:~ }|*15 + {2:-- }{5:match 2 of 3} | + ]]) + feed('<C-E><Esc>') + + feed('Sαβγ <C-X><C-O><C-N><C-N>') + screen:expect([[ + αβγ {8:你好}^ | + {1:~ }{n: foo }{1: }| + {1:~ }{n: bar }{1: }| + {1:~ }{s: 你好 }{1: }| + {1:~ }|*15 + {2:-- }{5:match 3 of 3} | + ]]) + feed('<C-E><Esc>') + + -- restore after accept + feed('Sαβγ <C-X><C-O><C-Y>') + screen:expect([[ + αβγ foo^ | + {1:~ }|*18 + {2:-- INSERT --} | + ]]) + feed('<Esc>') + + -- restore after cancel completion + feed('Sαβγ <C-X><C-O><Space>') + screen:expect([[ + αβγ foo ^ | + {1:~ }|*18 + {2:-- INSERT --} | + ]]) + feed('<Esc>') + end) end end |