annotate src/testdir/test_popup.vim @ 9438:7897b1e4f3e7 v7.4.2000

commit https://github.com/vim/vim/commit/245a7cb6d33e556415c9fcaa874b784a6d8f0ef3 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 8 10:53:12 2016 +0200 patch 7.4.2000 Problem: Evalcmd test fails. Solution: Add missing piece.
author Christian Brabandt <cb@256bit.org>
date Fri, 08 Jul 2016 11:00:06 +0200
parents 35b173e37dc6
children 203792348947
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9359
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for completion menu
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 inoremap <F5> <C-R>=ListMonths()<CR>
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 let g:setting = ''
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 func ListMonths()
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 if g:setting != ''
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 exe ":set" g:setting
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 endif
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 call complete(col('.'), g:months)
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 return ''
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 endfunc
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 func! Test_popup_completion_insertmode()
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 new
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 call feedkeys("a\<f5>\<down>\<enter>\<esc>", 'tx')
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 call assert_equal('February', getline(1))
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 %d
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 let g:setting = 'noinsertmode'
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 call feedkeys("a\<f5>\<down>\<enter>\<esc>", 'tx')
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 call assert_equal('February', getline(1))
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 call assert_false(pumvisible())
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 %d
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 let g:setting = ''
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 call feedkeys("a\<f5>". repeat("\<c-n>",12)."\<enter>\<esc>", 'tx')
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 call assert_equal('', getline(1))
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 %d
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 call feedkeys("a\<f5>\<c-p>\<enter>\<esc>", 'tx')
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 call assert_equal('', getline(1))
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 %d
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 call feedkeys("a\<f5>\<c-p>\<c-p>\<enter>\<esc>", 'tx')
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 call assert_equal('December', getline(1))
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 bwipe!
35b173e37dc6 commit https://github.com/vim/vim/commit/00672e1d3f59dbff91a18d418b2984be96f89ee5
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 endfunc