From 363ce5ecbb8f71081b3865df68fb25633bdc3557 Mon Sep 17 00:00:00 2001 From: Shewer Lu Date: Fri, 1 Jul 2022 12:25:49 +0800 Subject: [PATCH] Update easy_en.lua MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 存於 table 再 yield 無義意 如果有太多的candidates 收完再yield 反而造成delay --- lua/easy_en.lua | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lua/easy_en.lua b/lua/easy_en.lua index 5200722..02422b9 100644 --- a/lua/easy_en.lua +++ b/lua/easy_en.lua @@ -1,15 +1,9 @@ local function append_blank_filter(input) - local cands = {} - for cand in input:iter() do if (not cand.comment:find("☯")) then - table.insert(cands, cand) + yield(Candidate("word", cand.start, cand._end, cand.text .. " ", cand.comment)) end end - - for i, cand in ipairs(cands) do - yield(Candidate("word", cand.start, cand._end, cand.text .. " ", cand.comment)) - end end return { append_blank_filter = append_blank_filter }