nvim-cmp
nvim-cmp copied to clipboard
fix: cmdline fallback mapping for <S-Tab>
Closes #953
In my environment, this fix breaks <S-Tab> mapping.
I think the following keys is valid... WDYT?
['<Tab>'] = {
c = function()
local cmp = require('cmp')
if cmp.visible() then
cmp.select_next_item()
elseif vim.fn.pumvisible() == 1 then
feedkeys.call(keymap.t('<Tab>'), 'n')
else
feedkeys.call(keymap.t('<C-z><C-n>'), 'n')
end
end,
},
['<S-Tab>'] = {
c = function()
local cmp = require('cmp')
if cmp.visible() then
cmp.select_prev_item()
elseif vim.fn.pumvisible() == 1 then
feedkeys.call(keymap.t('<S-Tab>'), 'n')
else
feedkeys.call(keymap.t('<C-z><C-p>'), 'n')
end
end,
},
Hmm in my environment <Tab> skips an entry (moves twice instead of once), and <S-Tab> still doesn't work for some reason.
https://user-images.githubusercontent.com/62098008/166261764-6ce5fa86-d135-4495-8942-480e10e36146.mp4
EDIT: forgot to attach my cmp config but it can be found here. filter_mode(mappings, "c") returns a dictionary which doesn't contain any mappings for <Tab>, or <S-Tab>.