Fix #425
This commit is contained in:
@@ -101,29 +101,33 @@ return function()
|
|||||||
}),
|
}),
|
||||||
['<Tab>'] = mapping({
|
['<Tab>'] = mapping({
|
||||||
c = function(fallback)
|
c = function(fallback)
|
||||||
local c = require('cmp.config')
|
|
||||||
local cmp = require('cmp')
|
local cmp = require('cmp')
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
elseif not c.get().experimental.native_menu then
|
else
|
||||||
|
local sources = cmp.core:get_sources()
|
||||||
|
if #sources > 0 and not require('cmp.config').get().experimental.native_menu then
|
||||||
cmp.complete()
|
cmp.complete()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
}),
|
}),
|
||||||
['<S-Tab>'] = mapping({
|
['<S-Tab>'] = mapping({
|
||||||
c = function(fallback)
|
c = function(fallback)
|
||||||
local c = require('cmp.config')
|
|
||||||
local cmp = require('cmp')
|
local cmp = require('cmp')
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
elseif not c.get().experimental.native_menu then
|
else
|
||||||
|
local sources = cmp.core:get_sources()
|
||||||
|
if #sources > 0 and not require('cmp.config').get().experimental.native_menu then
|
||||||
cmp.complete()
|
cmp.complete()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
}),
|
}),
|
||||||
['<C-n>'] = mapping(mapping.select_next_item({ behavior = types.cmp.SelectBehavior.Insert }), { 'i', 'c' }),
|
['<C-n>'] = mapping(mapping.select_next_item({ behavior = types.cmp.SelectBehavior.Insert }), { 'i', 'c' }),
|
||||||
['<C-p>'] = mapping(mapping.select_prev_item({ behavior = types.cmp.SelectBehavior.Insert }), { 'i', 'c' }),
|
['<C-p>'] = mapping(mapping.select_prev_item({ behavior = types.cmp.SelectBehavior.Insert }), { 'i', 'c' }),
|
||||||
|
|||||||
Reference in New Issue
Block a user