summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_popup.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-06-16 16:51:25 +0200
committerChristian Brabandt <cb@256bit.org>2024-06-16 16:51:25 +0200
commit63901e89638d683ecbc8e3323170dd485657fd1d (patch)
treebdabc73f2e03c8158f58023bc6da04d91735e845 /src/testdir/test_popup.vim
parent917ff8a19d2746dd922b7292dc61fb92e18b7ce2 (diff)
patch 9.1.0494: Wrong matched text highlighted in pum with 'rightleft'v9.1.0494
Problem: Wrong matched text highlighted in pum with 'rightleft'. Solution: Match using the original text instead of the reversed text. (zeertzjq) closes: #15020 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir/test_popup.vim')
-rw-r--r--src/testdir/test_popup.vim35
1 files changed, 28 insertions, 7 deletions
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index b9c6b92d01..d1fa5a96f8 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -1390,6 +1390,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' },
@@ -1401,7 +1402,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')
@@ -1412,7 +1413,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)
@@ -1420,28 +1421,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