Improve cmdline handling

This commit is contained in:
hrsh7th
2021-10-28 02:03:29 +09:00
parent 58d081300b
commit d113902eef

View File

@@ -30,6 +30,7 @@ misc.set(_G, { 'cmp', 'plugin', 'cmdline', 'enter' }, function()
end end
local cmdtype = vim.fn.expand('<afile>') local cmdtype = vim.fn.expand('<afile>')
if cmdtype ~= '=' then if cmdtype ~= '=' then
if api.is_cmdline_mode() then
vim.cmd [[ vim.cmd [[
augroup cmp-cmdline augroup cmp-cmdline
autocmd! autocmd!
@@ -38,6 +39,7 @@ misc.set(_G, { 'cmp', 'plugin', 'cmdline', 'enter' }, function()
]] ]]
require('cmp.utils.autocmd').emit('InsertEnter') require('cmp.utils.autocmd').emit('InsertEnter')
end end
end
end) end)
misc.set(_G, { 'cmp', 'plugin', 'cmdline', 'leave' }, function() misc.set(_G, { 'cmp', 'plugin', 'cmdline', 'leave' }, function()