Re-fix native tab mapping
This commit is contained in:
@@ -102,32 +102,30 @@ return function()
|
|||||||
['<Tab>'] = mapping({
|
['<Tab>'] = mapping({
|
||||||
c = function(fallback)
|
c = function(fallback)
|
||||||
local cmp = require('cmp')
|
local cmp = require('cmp')
|
||||||
|
if #cmp.core:get_sources() > 0 and not require('cmp.config').get().experimental.native_menu then
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
else
|
else
|
||||||
local sources = cmp.core:get_sources()
|
|
||||||
if #sources > 0 and not require('cmp.config').get().experimental.native_menu then
|
|
||||||
cmp.complete()
|
cmp.complete()
|
||||||
|
end
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
}),
|
}),
|
||||||
['<S-Tab>'] = mapping({
|
['<S-Tab>'] = mapping({
|
||||||
c = function(fallback)
|
c = function(fallback)
|
||||||
local cmp = require('cmp')
|
local cmp = require('cmp')
|
||||||
|
if #cmp.core:get_sources() > 0 and not require('cmp.config').get().experimental.native_menu then
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
else
|
else
|
||||||
local sources = cmp.core:get_sources()
|
|
||||||
if #sources > 0 and not require('cmp.config').get().experimental.native_menu then
|
|
||||||
cmp.complete()
|
cmp.complete()
|
||||||
|
end
|
||||||
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