diff options
author | Shougo <Shougo.Matsu@gmail.com> | 2018-02-19 07:56:59 +0900 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-02-18 23:56:59 +0100 |
commit | 00665d3c701ef1b6b276f750a772a6aa8a42c8c1 (patch) | |
tree | d144bc9824f698909fe651451fed38bbbd752f36 /test/functional/viml/completion_spec.lua | |
parent | eccd60aaf4ebc445d45e51a73d0807242e496a6a (diff) | |
download | rneovim-00665d3c701ef1b6b276f750a772a6aa8a42c8c1.tar.gz rneovim-00665d3c701ef1b6b276f750a772a6aa8a42c8c1.tar.bz2 rneovim-00665d3c701ef1b6b276f750a772a6aa8a42c8c1.zip |
vim-patch:8.0.1493: completion items cannot be annotated (#8003)
Problem: Completion items cannot be annotated.
Solution: Add a "user_data" entry to the completion item. (Ben Jackson,
coses vim/vim#2608, closes vim/vim#2508)
https://github.com/vim/vim/commit/9b56a57cdae31f7a2c85d440392bf63d3253a158
Diffstat (limited to 'test/functional/viml/completion_spec.lua')
-rw-r--r-- | test/functional/viml/completion_spec.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/functional/viml/completion_spec.lua b/test/functional/viml/completion_spec.lua index fbc7a527f8..216ccb3744 100644 --- a/test/functional/viml/completion_spec.lua +++ b/test/functional/viml/completion_spec.lua @@ -59,7 +59,8 @@ describe('completion', function() it('returns expected dict in normal completion', function() feed('ifoo<ESC>o<C-x><C-n>') eq('foo', eval('getline(2)')) - eq({word = 'foo', abbr = '', menu = '', info = '', kind = ''}, + eq({word = 'foo', abbr = '', menu = '', + info = '', kind = '', user_data = ''}, eval('v:completed_item')) end) it('is readonly', function() @@ -84,13 +85,18 @@ describe('completion', function() feed_command('let v:completed_item.kind = "bar"') neq(nil, string.find(eval('v:errmsg'), '^E46: ')) feed_command('let v:errmsg = ""') + + feed_command('let v:completed_item.user_data = "bar"') + neq(nil, string.find(eval('v:errmsg'), '^E46: ')) + feed_command('let v:errmsg = ""') end) it('returns expected dict in omni completion', function() source([[ function! TestOmni(findstart, base) abort return a:findstart ? 0 : [{'word': 'foo', 'abbr': 'bar', \ 'menu': 'baz', 'info': 'foobar', 'kind': 'foobaz'}, - \ {'word': 'word', 'abbr': 'abbr', 'menu': 'menu', 'info': 'info', 'kind': 'kind'}] + \ {'word': 'word', 'abbr': 'abbr', 'menu': 'menu', + \ 'info': 'info', 'kind': 'kind'}] endfunction setlocal omnifunc=TestOmni ]]) @@ -107,7 +113,7 @@ describe('completion', function() {3:-- Omni completion (^O^N^P) }{4:match 1 of 2} | ]]) eq({word = 'foo', abbr = 'bar', menu = 'baz', - info = 'foobar', kind = 'foobaz'}, + info = 'foobar', kind = 'foobaz', user_data = ''}, eval('v:completed_item')) end) end) |