aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-06-17 06:42:11 +0800
committerGitHub <noreply@github.com>2024-06-17 06:42:11 +0800
commit20a7eebec086129e605041d32916f36df50890de (patch)
treebf04beba43f01f07e9094a380c9108e8dd9e9c60 /test/old/testdir
parent7746c54e108ebfccde5fa8748deab31e996d412d (diff)
downloadrneovim-20a7eebec086129e605041d32916f36df50890de.tar.gz
rneovim-20a7eebec086129e605041d32916f36df50890de.tar.bz2
rneovim-20a7eebec086129e605041d32916f36df50890de.zip
vim-patch:9.1.0494: Wrong matched text highlighted in pum with 'rightleft' (#29371)
Problem: Wrong matched text highlighted in pum with 'rightleft'. Solution: Match using the original text instead of the reversed text. (zeertzjq) closes: vim/vim#15020 https://github.com/vim/vim/commit/63901e89638d683ecbc8e3323170dd485657fd1d
Diffstat (limited to 'test/old/testdir')
-rw-r--r--test/old/testdir/test_popup.vim35
1 files changed, 28 insertions, 7 deletions
diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim
index b6b8b44f82..6c14fb3a6e 100644
--- a/test/old/testdir/test_popup.vim
+++ b/test/old/testdir/test_popup.vim
@@ -1397,6 +1397,7 @@ func Test_pum_highlights_match()
return {
\ 'words': [
\ { 'word': 'foo', 'kind': 'fookind' },
+ \ { 'word': 'foofoo', 'kind': 'fookind' },
\ { 'word': 'foobar', 'kind': 'fookind' },
\ { 'word': 'fooBaz', 'kind': 'fookind' },
\ { 'word': 'foobala', 'kind': 'fookind' },
@@ -1408,7 +1409,7 @@ func Test_pum_highlights_match()
endfunc
set omnifunc=Omni_test
set completeopt=menu,noinsert,fuzzy
- hi PmenuMatchSel ctermfg=6 ctermbg=225
+ hi PmenuMatchSel ctermfg=6 ctermbg=7
hi PmenuMatch ctermfg=4 ctermbg=225
END
call writefile(lines, 'Xscript', 'D')
@@ -1419,7 +1420,7 @@ func Test_pum_highlights_match()
call term_sendkeys(buf, "fo")
call TermWait(buf, 50)
call VerifyScreenDump(buf, 'Test_pum_highlights_03', {})
- call term_sendkeys(buf, "\<ESC>S\<C-x>\<C-O>")
+ call term_sendkeys(buf, "\<Esc>S\<C-X>\<C-O>")
call TermWait(buf, 50)
call term_sendkeys(buf, "你")
call TermWait(buf, 50)
@@ -1427,28 +1428,48 @@ func Test_pum_highlights_match()
call term_sendkeys(buf, "吗")
call TermWait(buf, 50)
call VerifyScreenDump(buf, 'Test_pum_highlights_05', {})
+ call term_sendkeys(buf, "\<C-E>\<Esc>")
if has('rightleft')
- call term_sendkeys(buf, "\<C-E>\<ESC>u:set rightleft\<CR>")
+ call term_sendkeys(buf, ":set rightleft\<CR>")
call TermWait(buf, 50)
- call term_sendkeys(buf, "i\<C-X>\<C-O>")
+ call term_sendkeys(buf, "S\<C-X>\<C-O>")
call TermWait(buf, 50)
call term_sendkeys(buf, "fo")
call TermWait(buf, 50)
call VerifyScreenDump(buf, 'Test_pum_highlights_06', {})
- call term_sendkeys(buf, "\<C-E>\<ESC>u:set norightleft\<CR>")
+ call term_sendkeys(buf, "\<Esc>S\<C-X>\<C-O>")
+ call TermWait(buf, 50)
+ call term_sendkeys(buf, "你")
+ call VerifyScreenDump(buf, 'Test_pum_highlights_06a', {})
+ call term_sendkeys(buf, "吗")
+ call VerifyScreenDump(buf, 'Test_pum_highlights_06b', {})
+ call term_sendkeys(buf, "\<C-E>\<Esc>")
+ call term_sendkeys(buf, ":set norightleft\<CR>")
call TermWait(buf)
endif
call term_sendkeys(buf, ":set completeopt-=fuzzy\<CR>")
call TermWait(buf)
- call term_sendkeys(buf, "\<ESC>S\<C-x>\<C-O>")
+ call term_sendkeys(buf, "S\<C-X>\<C-O>")
call TermWait(buf, 50)
call term_sendkeys(buf, "fo")
call TermWait(buf, 50)
call VerifyScreenDump(buf, 'Test_pum_highlights_07', {})
+ call term_sendkeys(buf, "\<C-E>\<Esc>")
+
+ if has('rightleft')
+ call term_sendkeys(buf, ":set rightleft\<CR>")
+ call TermWait(buf, 50)
+ call term_sendkeys(buf, "S\<C-X>\<C-O>")
+ call TermWait(buf, 50)
+ call term_sendkeys(buf, "fo")
+ call TermWait(buf, 50)
+ call VerifyScreenDump(buf, 'Test_pum_highlights_08', {})
+ call term_sendkeys(buf, "\<C-E>\<Esc>")
+ call term_sendkeys(buf, ":set norightleft\<CR>")
+ endif
- call term_sendkeys(buf, "\<C-E>\<Esc>u")
call TermWait(buf)
call StopVimInTerminal(buf)
endfunc