Improve macro handling

This commit is contained in:
hrsh7th
2022-04-08 22:04:08 +09:00
parent 27970d8a1c
commit 801a9f98bb
4 changed files with 21 additions and 30 deletions

View File

@@ -8,7 +8,11 @@ local WIDE_HEIGHT = 40
return function()
return {
enabled = function()
return vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt'
local disabled = false
disabled = disabled or (vim.api.nvim_buf_get_option(0, 'buftype') == 'prompt')
disabled = disabled or (vim.fn.reg_recording() ~= '')
disabled = disabled or (vim.fn.reg_executing() ~= '')
return not disabled
end,
preselect = types.cmp.PreselectMode.Item,