aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-09-02 16:44:08 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-09-02 18:40:56 -0400
commit02f126a2758e834a7e9dfbae0ede48bf8b90512f (patch)
treeaff61c2bc13ff9a811e7f2ad5d1fc422ce2d4bb7 /src/nvim/testdir
parent07b209b1fec19d4e8d7e5390c664d582d6a3145c (diff)
downloadrneovim-02f126a2758e834a7e9dfbae0ede48bf8b90512f.tar.gz
rneovim-02f126a2758e834a7e9dfbae0ede48bf8b90512f.tar.bz2
rneovim-02f126a2758e834a7e9dfbae0ede48bf8b90512f.zip
vim-patch:8.0.1806: InsertCharPre causes problems for autocomplete
Problem: InsertCharPre causes problems for autocomplete. (Lifepillar) Solution: Check for InsertCharPre before calling vpeekc(). (Christian Brabandt, closes vim/vim#2876) https://github.com/vim/vim/commit/39de95257714b76ccd845d081cff57830a79b488
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_popup.vim30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim
index 162df4b76e..53df30bb19 100644
--- a/src/nvim/testdir/test_popup.vim
+++ b/src/nvim/testdir/test_popup.vim
@@ -746,6 +746,36 @@ func Test_popup_complete_backwards()
bwipe!
endfunc
+fun! Test_complete_o_tab()
+ throw 'skipped: Nvim does not support test_override()'
+ let s:o_char_pressed = 0
+
+ fun! s:act_on_text_changed()
+ if s:o_char_pressed
+ let s:o_char_pressed = 0
+ call feedkeys("\<c-x>\<c-n>", 'i')
+ endif
+ endf
+
+ set completeopt=menu,noselect
+ new
+ imap <expr> <buffer> <tab> pumvisible() ? "\<c-p>" : "X"
+ autocmd! InsertCharPre <buffer> let s:o_char_pressed = (v:char ==# 'o')
+ autocmd! TextChangedI <buffer> call <sid>act_on_text_changed()
+ call setline(1, ['hoard', 'hoax', 'hoarse', ''])
+ let l:expected = ['hoard', 'hoax', 'hoarse', 'hoax', 'hoax']
+ call cursor(4,1)
+ call test_override("char_avail", 1)
+ call feedkeys("Ahoa\<tab>\<tab>\<c-y>\<esc>", 'tx')
+ call feedkeys("oho\<tab>\<tab>\<c-y>\<esc>", 'tx')
+ call assert_equal(l:expected, getline(1,'$'))
+
+ call test_override("char_avail", 0)
+ bwipe!
+ set completeopt&
+ delfunc s:act_on_text_changed
+endf
+
func Test_popup_complete_info_01()
new
inoremap <buffer><F5> <C-R>=complete_info().mode<CR>