Fix #217
This commit is contained in:
@@ -65,6 +65,12 @@ context.new = function(prev_context, option)
|
||||
return self
|
||||
end
|
||||
|
||||
---Return the context is invalid or not.
|
||||
---@return boolean
|
||||
context.invalid = function(self)
|
||||
return string.sub(self.mode, 1, 1) ~= 'i'
|
||||
end
|
||||
|
||||
---Return context creation reason.
|
||||
---@return cmp.ContextReason
|
||||
context.get_reason = function(self)
|
||||
|
||||
@@ -243,6 +243,10 @@ end
|
||||
---Invoke completion
|
||||
---@param ctx cmp.Context
|
||||
core.complete = function(ctx)
|
||||
if ctx:invalid() then
|
||||
return
|
||||
end
|
||||
|
||||
core.set_context(ctx)
|
||||
|
||||
local callback = function()
|
||||
@@ -265,6 +269,9 @@ end
|
||||
---Update completion menu
|
||||
core.filter = async.throttle(function()
|
||||
local ctx = core.get_context()
|
||||
if ctx:invalid() then
|
||||
return
|
||||
end
|
||||
|
||||
-- To wait for processing source for that's timeout.
|
||||
local sources = {}
|
||||
|
||||
Reference in New Issue
Block a user