diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2018-06-16 12:01:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-16 12:01:09 +0200 |
| commit | 4bb039e2257ede3faf968ef9adcb786e2f41ffe5 (patch) | |
| tree | 03105b8ecf733088c0745b8524a11c27b42e92b7 /src/nvim/testdir | |
| parent | 4c3c04d03cc0cdbccfb71b534fc3cd238fd3974d (diff) | |
| parent | 3462acbbff7a56abf7abc1393e6b212332adecdb (diff) | |
| download | rneovim-4bb039e2257ede3faf968ef9adcb786e2f41ffe5.tar.gz rneovim-4bb039e2257ede3faf968ef9adcb786e2f41ffe5.tar.bz2 rneovim-4bb039e2257ede3faf968ef9adcb786e2f41ffe5.zip | |
Merge #8543 from janlazo/vim-8.0.0596
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_popup.vim | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim index f5bdd717dd..ea98379f04 100644 --- a/src/nvim/testdir/test_popup.vim +++ b/src/nvim/testdir/test_popup.vim @@ -608,4 +608,47 @@ func Test_popup_and_preview_autocommand() bw! endfunc +fun MessCompleteMonths() + for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep") + call complete_add(m) + if complete_check() + break + endif + endfor + return [] +endfun + +fun MessCompleteMore() + call complete(1, split("Oct Nov Dec")) + return [] +endfun + +fun MessComplete(findstart, base) + if a:findstart + let line = getline('.') + let start = col('.') - 1 + while start > 0 && line[start - 1] =~ '\a' + let start -= 1 + endwhile + return start + else + call MessCompleteMonths() + call MessCompleteMore() + return [] + endif +endf + +func Test_complete_func_mess() + " Calling complete() after complete_add() in 'completefunc' is wrong, but it + " should not crash. + set completefunc=MessComplete + new + call setline(1, 'Ju') + call feedkeys("A\<c-x>\<c-u>/\<esc>", 'tx') + call assert_equal('Oct/Oct', getline(1)) + bwipe! + set completefunc= +endfunc + + " vim: shiftwidth=2 sts=2 expandtab |