mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.0.0035 (#5609)
Problem: Order of matches for 'omnifunc' is messed up. (Danny Su)
Solution: Do not set compl_curr_match when called from complete_check().
(closes vim/vim#1168)
472e85970e
This commit is contained in:
@@ -1,68 +0,0 @@
|
||||
-- Tests for completefunc/omnifunc.
|
||||
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local feed, insert, source = helpers.feed, helpers.insert, helpers.source
|
||||
local clear, expect, execute = helpers.clear, helpers.expect, helpers.execute
|
||||
|
||||
describe('completefunc', function()
|
||||
setup(clear)
|
||||
|
||||
it('is working', function()
|
||||
insert([=[
|
||||
+++
|
||||
one
|
||||
two
|
||||
three]=])
|
||||
|
||||
-- Test that nothing happens if the 'completefunc' opens
|
||||
-- a new window (no completion, no crash).
|
||||
source([=[
|
||||
function! DummyCompleteOne(findstart, base)
|
||||
if a:findstart
|
||||
return 0
|
||||
else
|
||||
wincmd n
|
||||
return ['onedef', 'oneDEF']
|
||||
endif
|
||||
endfunction
|
||||
setlocal completefunc=DummyCompleteOne
|
||||
/^one
|
||||
]=])
|
||||
feed('A<C-X><C-U><C-N><esc>')
|
||||
execute('q!')
|
||||
source([=[
|
||||
function! DummyCompleteTwo(findstart, base)
|
||||
if a:findstart
|
||||
wincmd n
|
||||
return 0
|
||||
else
|
||||
return ['twodef', 'twoDEF']
|
||||
endif
|
||||
endfunction
|
||||
setlocal completefunc=DummyCompleteTwo
|
||||
/^two
|
||||
]=])
|
||||
feed('A<C-X><C-U><C-N><esc>')
|
||||
execute('q!')
|
||||
-- Test that 'completefunc' works when it's OK.
|
||||
source([=[
|
||||
function! DummyCompleteThree(findstart, base)
|
||||
if a:findstart
|
||||
return 0
|
||||
else
|
||||
return ['threedef', 'threeDEF']
|
||||
endif
|
||||
endfunction
|
||||
setlocal completefunc=DummyCompleteThree
|
||||
/^three
|
||||
]=])
|
||||
feed('A<C-X><C-U><C-N><esc>')
|
||||
|
||||
-- Assert buffer contents.
|
||||
expect([=[
|
||||
+++
|
||||
|
||||
two
|
||||
threeDEF]=])
|
||||
end)
|
||||
end)
|
||||
Reference in New Issue
Block a user