From 3417d0696d8a0c2847c20af6235165221d2a70fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 15 Dec 2021 11:42:11 +0800 Subject: `FIX` completion: incorrect cache --- script/core/completion/completion.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'script/core/completion') diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index cb2ce8dd..efd62fb6 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -1945,6 +1945,7 @@ local function makeCache(uri, position, results) cache.position= position cache.word = word:lower() cache.length = #word + cache.uri = uri end local function isValidCache(word, result) @@ -1969,6 +1970,9 @@ local function getCache(uri, position) if not cache.results then return nil end + if cache.uri ~= uri then + return nil + end local text = files.getText(uri) local state = files.getState(uri) local word = lookBackward.findWord(text, guide.positionToOffset(state, position)) -- cgit v1.2.3