diff options
| author | glepnir <glephunter@gmail.com> | 2025-02-09 10:43:02 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-09 10:43:02 +0800 |
| commit | 53e737748e0e5c032fd6e2c2172c94bc5baf0cb7 (patch) | |
| tree | 30049854ad1b714530a3d470703e25a05fd7de65 /test/old/testdir | |
| parent | ec3071ffad8e4cf043e93e1c679a37c947856a26 (diff) | |
| download | rneovim-53e737748e0e5c032fd6e2c2172c94bc5baf0cb7.tar.gz rneovim-53e737748e0e5c032fd6e2c2172c94bc5baf0cb7.tar.bz2 rneovim-53e737748e0e5c032fd6e2c2172c94bc5baf0cb7.zip | |
vim-patch:9.1.1086: completion doesn't work with multi lines (#32377)
Problem: completion doesn't work with multi lines
(Łukasz Jan Niemier)
Solution: handle linebreaks in completion code as expected
(glepnir)
fixes: vim/vim#2505
closes: vim/vim#15373
https://github.com/vim/vim/commit/76bdb82527a13b5b2baa8f7d7ce14b4d5dc05b82
Diffstat (limited to 'test/old/testdir')
| -rw-r--r-- | test/old/testdir/test_popup.vim | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim index e4abf978ab..7f80c60118 100644 --- a/test/old/testdir/test_popup.vim +++ b/test/old/testdir/test_popup.vim @@ -1885,4 +1885,59 @@ func Test_popup_completion_many_ctrlp() bw! endfunc +func Test_pum_complete_with_special_characters() + CheckScreendump + + let lines =<< trim END + func Omni_test(findstart, base) + if a:findstart + return col(".") + endif + return [#{word: "func ()\n\t\nend", abbr: "function ()",}, #{word: "foobar"}, #{word: "你好\n\t\n我好"}] + endfunc + set omnifunc=Omni_test + END + + call writefile(lines, 'Xpreviewscript', 'D') + let buf = RunVimInTerminal('-S Xpreviewscript', #{rows: 12}) + call term_sendkeys(buf, "S\<C-X>\<C-O>") + call TermWait(buf, 50) + call VerifyScreenDump(buf, 'Test_pum_with_special_characters_01', {}) + + call term_sendkeys(buf, "\<C-N>") + call TermWait(buf, 50) + call VerifyScreenDump(buf, 'Test_pum_with_special_characters_02', {}) + call term_sendkeys(buf, "\<C-E>\<Esc>") + + call term_sendkeys(buf, "Shello hero\<ESC>hhhhha\<C-X>\<C-O>") + call TermWait(buf, 50) + call VerifyScreenDump(buf, 'Test_pum_with_special_characters_03', {}) + + call term_sendkeys(buf, "\<C-N>") + call TermWait(buf, 50) + call VerifyScreenDump(buf, 'Test_pum_with_special_characters_04', {}) + + call term_sendkeys(buf, "\<C-N>") + call TermWait(buf, 50) + call VerifyScreenDump(buf, 'Test_pum_with_special_characters_05', {}) + + call term_sendkeys(buf, "\<C-N>") + call TermWait(buf, 50) + call VerifyScreenDump(buf, 'Test_pum_with_special_characters_06', {}) + call term_sendkeys(buf, "\<C-E>\<Esc>") + + call term_sendkeys(buf, ":hi ComplMatchIns ctermfg=red\<CR>") + call TermWait(buf, 50) + call term_sendkeys(buf, "S\<C-X>\<C-O>") + call VerifyScreenDump(buf, 'Test_pum_with_special_characters_07', {}) + call term_sendkeys(buf, "\<C-E>\<Esc>") + + call term_sendkeys(buf, "Shello hero\<ESC>hhhhha\<C-X>\<C-O>") + call TermWait(buf, 50) + call VerifyScreenDump(buf, 'Test_pum_with_special_characters_08', {}) + call term_sendkeys(buf, "\<C-E>\<Esc>") + + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab |