Improve macro & dot-repeat support (#363)
* manual support dot-repeat * cmdwin and terminal * cmdline only * Fix * fix * Improve * Fix test * Support macro * disable cmdline for now * Simplify * fmt * consume once * Ignore = type * cmdline * Remove cmdline features
This commit is contained in:
@@ -84,6 +84,12 @@ end
|
||||
---Select next item if possible
|
||||
cmp.select_next_item = function(option)
|
||||
option = option or {}
|
||||
|
||||
-- Hack: Ignore when executing macro.
|
||||
if vim.fn.reg_executing() ~= '' then
|
||||
return true
|
||||
end
|
||||
|
||||
if cmp.core.view:visible() then
|
||||
local release = cmp.core:suspend()
|
||||
cmp.core.view:select_next_item(option)
|
||||
@@ -103,6 +109,12 @@ end
|
||||
---Select prev item if possible
|
||||
cmp.select_prev_item = function(option)
|
||||
option = option or {}
|
||||
|
||||
-- Hack: Ignore when executing macro.
|
||||
if vim.fn.reg_executing() ~= '' then
|
||||
return true
|
||||
end
|
||||
|
||||
if cmp.core.view:visible() then
|
||||
local release = cmp.core:suspend()
|
||||
cmp.core.view:select_prev_item(option)
|
||||
@@ -133,6 +145,11 @@ end
|
||||
cmp.confirm = function(option)
|
||||
option = option or {}
|
||||
|
||||
-- Hack: Ignore when executing macro.
|
||||
if vim.fn.reg_executing() ~= '' then
|
||||
return true
|
||||
end
|
||||
|
||||
local e = cmp.core.view:get_selected_entry() or (option.select and cmp.core.view:get_first_entry() or nil)
|
||||
if e then
|
||||
cmp.core:confirm(e, {
|
||||
|
||||
Reference in New Issue
Block a user