From 63901e89638d683ecbc8e3323170dd485657fd1d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 16 Jun 2024 16:51:25 +0200 Subject: patch 9.1.0494: Wrong matched text highlighted in pum with 'rightleft' 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 Signed-off-by: Christian Brabandt --- src/testdir/test_popup.vim | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'src/testdir/test_popup.vim') 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, "\S\\") + call term_sendkeys(buf, "\S\\") 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, "\\") if has('rightleft') - call term_sendkeys(buf, "\\u:set rightleft\") + call term_sendkeys(buf, ":set rightleft\") call TermWait(buf, 50) - call term_sendkeys(buf, "i\\") + call term_sendkeys(buf, "S\\") call TermWait(buf, 50) call term_sendkeys(buf, "fo") call TermWait(buf, 50) call VerifyScreenDump(buf, 'Test_pum_highlights_06', {}) - call term_sendkeys(buf, "\\u:set norightleft\") + call term_sendkeys(buf, "\S\\") + 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, "\\") + call term_sendkeys(buf, ":set norightleft\") call TermWait(buf) endif call term_sendkeys(buf, ":set completeopt-=fuzzy\") call TermWait(buf) - call term_sendkeys(buf, "\S\\") + call term_sendkeys(buf, "S\\") call TermWait(buf, 50) call term_sendkeys(buf, "fo") call TermWait(buf, 50) call VerifyScreenDump(buf, 'Test_pum_highlights_07', {}) + call term_sendkeys(buf, "\\") + + if has('rightleft') + call term_sendkeys(buf, ":set rightleft\") + call TermWait(buf, 50) + call term_sendkeys(buf, "S\\") + call TermWait(buf, 50) + call term_sendkeys(buf, "fo") + call TermWait(buf, 50) + call VerifyScreenDump(buf, 'Test_pum_highlights_08', {}) + call term_sendkeys(buf, "\\") + call term_sendkeys(buf, ":set norightleft\") + endif - call term_sendkeys(buf, "\\u") call TermWait(buf) call StopVimInTerminal(buf) endfunc -- cgit v1.2.3