From a61c36a639a1662a5d27b1a88086b9c91d7d49a8 Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Wed, 1 Dec 2021 15:03:59 +0900 Subject: [PATCH] fmt --- lua/cmp/core.lua | 18 +++++++++--------- lua/cmp/utils/misc_spec.lua | 1 - 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lua/cmp/core.lua b/lua/cmp/core.lua index 9347a21..2dcc08c 100644 --- a/lua/cmp/core.lua +++ b/lua/cmp/core.lua @@ -230,17 +230,17 @@ core.complete = function(self, ctx) if s_.incomplete and new:changed(s_.context) then s_:complete(new, callback) else - for _, s__ in ipairs(self:get_sources({ source.SourceStatus.FETCHING })) do - if s_ == s__ then - break - end - if not s__.incomplete and SOURCE_TIMEOUT > s__:get_fetching_time() then - return + for _, s__ in ipairs(self:get_sources({ source.SourceStatus.FETCHING })) do + if s_ == s__ then + break + end + if not s__.incomplete and SOURCE_TIMEOUT > s__:get_fetching_time() then + return + end end + self.filter.timeout = self.view:visible() and THROTTLE_TIME or 0 + self:filter() end - self.filter.timeout = self.view:visible() and THROTTLE_TIME or 0 - self:filter() - end end end)(s) s:complete(ctx, callback) diff --git a/lua/cmp/utils/misc_spec.lua b/lua/cmp/utils/misc_spec.lua index 1cafe29..4e705ef 100644 --- a/lua/cmp/utils/misc_spec.lua +++ b/lua/cmp/utils/misc_spec.lua @@ -48,5 +48,4 @@ describe('misc', function() }) assert.are.equal(merged.a, nil) end) - end)