aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-06-18 06:02:01 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-06-18 06:18:58 +0800
commitc2491fbab43fc506f7f902c72206d890e01688a5 (patch)
treec2f9d18c6238808e1480cf6a8bd0cd1e5aab8e42 /test
parentc429c5f86fb8286bbb28e96985d9cc212155201b (diff)
downloadrneovim-c2491fbab43fc506f7f902c72206d890e01688a5.tar.gz
rneovim-c2491fbab43fc506f7f902c72206d890e01688a5.tar.bz2
rneovim-c2491fbab43fc506f7f902c72206d890e01688a5.zip
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 <glephunter@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/functional/ui/popupmenu_spec.lua28
-rw-r--r--test/old/testdir/test_popup.vim21
2 files changed, 49 insertions, 0 deletions
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('<C-E><Esc>')
command('set norightleft')
+
+ feed('S<C-R>=Comp()<CR>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<BS><C-R>=Comp()<CR>')
+ screen:expect_unchanged(true)
+
+ feed('<C-E><Esc>')
end)
end
end
diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim
index 6c14fb3a6e..bfd81ad0a9 100644
--- a/test/old/testdir/test_popup.vim
+++ b/test/old/testdir/test_popup.vim
@@ -1407,6 +1407,20 @@ func Test_pum_highlights_match()
\ { '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 ctermfg=6 ctermbg=7
@@ -1470,7 +1484,14 @@ func Test_pum_highlights_match()
call term_sendkeys(buf, ":set norightleft\<CR>")
endif
+ call term_sendkeys(buf, "S\<C-R>=Comp()\<CR>f")
+ call VerifyScreenDump(buf, 'Test_pum_highlights_09', {})
+ call term_sendkeys(buf, "o\<BS>\<C-R>=Comp()\<CR>")
+ call VerifyScreenDump(buf, 'Test_pum_highlights_09', {})
+
+ call term_sendkeys(buf, "\<C-E>\<Esc>")
call TermWait(buf)
+
call StopVimInTerminal(buf)
endfunc