fix(async): properly trigger callbacks when canceling and fix delays in throttle.sync (#1611)
This commit is contained in:
@@ -383,12 +383,11 @@ entry.match = function(self, input, matching_config)
|
||||
score, matches = matcher.match(input, filter_text, option)
|
||||
|
||||
-- Support the language server that doesn't respect VSCode's behaviors.
|
||||
local prefix = ''
|
||||
if score == 0 then
|
||||
if self:get_completion_item().textEdit and not misc.empty(self:get_completion_item().textEdit.newText) then
|
||||
local diff = self.source_offset - self:get_offset()
|
||||
if diff > 0 then
|
||||
prefix = string.sub(self.context.cursor_line, self:get_offset(), self:get_offset() + diff)
|
||||
local prefix = string.sub(self.context.cursor_line, self:get_offset(), self:get_offset() + diff)
|
||||
local accept = nil
|
||||
accept = accept or string.match(prefix, '^[^%a]+$')
|
||||
accept = accept or string.find(self:get_completion_item().textEdit.newText, prefix, 1, true)
|
||||
|
||||
Reference in New Issue
Block a user