From c2491fbab43fc506f7f902c72206d890e01688a5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 18 Jun 2024 06:02:01 +0800 Subject: vim-patch:9.1.0496: matched text is highlighted case-sensitively Problem: matched text is highlighted case-sensitively Solution: use MB_STRNICMP, update highlighting when the base changes (glepnir) fixes: vim/vim#15021 closes: vim/vim#15023 https://github.com/vim/vim/commit/f189138b39a11ed5cf3adea6610469b478841aba Co-authored-by: glepnir --- test/functional/ui/popupmenu_spec.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test/functional/ui/popupmenu_spec.lua') diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index fac863ead0..a1a21eb317 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -4739,6 +4739,20 @@ describe('builtin popupmenu', function() \ { 'word': '你可好吗' }, \]} endfunc + + func Comp() + let col = col('.') + if getline('.') == 'f' + let col -= 1 + endif + call complete(col, [ + \ #{word: "foo", icase: 1}, + \ #{word: "Foobar", icase: 1}, + \ #{word: "fooBaz", icase: 1}, + \]) + return '' + endfunc + set omnifunc=Omni_test set completeopt=menu,noinsert,fuzzy hi PmenuMatchSel guifg=Blue guibg=Grey @@ -4878,6 +4892,20 @@ describe('builtin popupmenu', function() ]]) feed('') command('set norightleft') + + feed('S=Comp()f') + screen:expect([[ + f^ | + {ms:f}{s:oo }{1: }| + {mn:F}{n:oobar }{1: }| + {mn:f}{n:ooBaz }{1: }| + {1:~ }|*15 + {2:-- INSERT --} | + ]]) + feed('o=Comp()') + screen:expect_unchanged(true) + + feed('') end) end end -- cgit