Fix literal tabs not working

This commit is contained in:
Warren Hood 2023-01-18 16:03:48 +02:00
parent 1b30e6d49d
commit 7913d705ee

View file

@ -21,8 +21,20 @@ cmp.setup({
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<Tab>"] = cmp.mapping(function() if cmp.visible() then cmp.select_next_item() end end),
["<S-Tab>"] = cmp.mapping(function() if cmp.visible() then cmp.select_prev_item() end end),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },