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:
hrsh7th
2021-10-16 23:37:32 +09:00
committed by GitHub
parent f0a6cca5b9
commit 0f28030aef
13 changed files with 279 additions and 84 deletions

View File

@@ -1,11 +1,17 @@
local mapping = setmetatable({}, {
local api = require('cmp.utils.api')
local mapping
mapping = setmetatable({}, {
__call = function(_, invoke, modes)
return {
invoke = function(...)
invoke(...)
end,
modes = modes or { 'i' },
}
if type(invoke) == 'function' then
return {
invoke = function(...)
invoke(...)
end,
modes = modes or { 'i' },
}
end
return invoke
end,
})