mirror of
https://github.com/neovim/neovim.git
synced 2026-07-16 14:11:28 +00:00
vim-patch:9.1.0941: ComplMatchIns doesn't work after multibyte chars
Problem: ComplMatchIns doesn't work after multibyte chars
(after v9.1.0936)
Solution: Use (ptr - line) instead of wlv.col (zeertzjq).
closes: vim/vim#16233
f4ccada5c3
This commit is contained in:
@@ -5561,6 +5561,71 @@ describe('builtin popupmenu', function()
|
||||
]])
|
||||
feed('<C-E><ESC>')
|
||||
end)
|
||||
|
||||
-- oldtest: Test_pum_matchins_higlight()
|
||||
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
|
||||
|
||||
|
||||
@@ -1729,29 +1729,29 @@ func Test_pum_matchins_higlight()
|
||||
let buf = RunVimInTerminal('-S Xscript', {})
|
||||
|
||||
call TermWait(buf)
|
||||
call term_sendkeys(buf, "S\<C-X>\<C-O>")
|
||||
call term_sendkeys(buf, "Sαβγ \<C-X>\<C-O>")
|
||||
call VerifyScreenDump(buf, 'Test_pum_matchins_01', {})
|
||||
call term_sendkeys(buf, "\<C-E>\<Esc>")
|
||||
|
||||
call TermWait(buf)
|
||||
call term_sendkeys(buf, "S\<C-X>\<C-O>\<C-N>")
|
||||
call term_sendkeys(buf, "Sαβγ \<C-X>\<C-O>\<C-N>")
|
||||
call VerifyScreenDump(buf, 'Test_pum_matchins_02', {})
|
||||
call term_sendkeys(buf, "\<C-E>\<Esc>")
|
||||
|
||||
call TermWait(buf)
|
||||
call term_sendkeys(buf, "S\<C-X>\<C-O>\<C-N>\<C-N>")
|
||||
call term_sendkeys(buf, "Sαβγ \<C-X>\<C-O>\<C-N>\<C-N>")
|
||||
call VerifyScreenDump(buf, 'Test_pum_matchins_03', {})
|
||||
call term_sendkeys(buf, "\<C-E>\<Esc>")
|
||||
|
||||
" restore after accept
|
||||
call TermWait(buf)
|
||||
call term_sendkeys(buf, "S\<C-X>\<C-O>\<C-Y>")
|
||||
call term_sendkeys(buf, "Sαβγ \<C-X>\<C-O>\<C-Y>")
|
||||
call VerifyScreenDump(buf, 'Test_pum_matchins_04', {})
|
||||
call term_sendkeys(buf, "\<C-E>\<Esc>")
|
||||
|
||||
" restore after cancel completion
|
||||
call TermWait(buf)
|
||||
call term_sendkeys(buf, "S\<C-X>\<C-O>\<Space>")
|
||||
call term_sendkeys(buf, "Sαβγ \<C-X>\<C-O>\<Space>")
|
||||
call VerifyScreenDump(buf, 'Test_pum_matchins_05', {})
|
||||
call term_sendkeys(buf, "\<C-E>\<Esc>")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user