summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/searcher.lua15
-rw-r--r--script/files.lua21
-rw-r--r--script/parser/guide.lua2
-rw-r--r--test/full/projects.lua2
4 files changed, 24 insertions, 16 deletions
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index dd4e4730..74e57736 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -369,6 +369,9 @@ function m.searchRefsByID(status, uri, expect, mode)
searchID(newID)
end
+ local ftag = {}
+ local btag = {}
+
local function checkThenPushTag(ward, tag)
if not tag then
return true
@@ -376,11 +379,11 @@ function m.searchRefsByID(status, uri, expect, mode)
local checkTags
local pushTags
if ward == 'forward' then
- checkTags = status.btag
- pushTags = status.ftag
+ checkTags = btag
+ pushTags = ftag
else
- checkTags = status.ftag
- pushTags = status.btag
+ checkTags = ftag
+ pushTags = btag
end
if checkTags[tag] and checkTags[tag] > 0 then
return false
@@ -395,9 +398,9 @@ function m.searchRefsByID(status, uri, expect, mode)
end
local popTags
if ward == 'forward' then
- popTags = status.ftag
+ popTags = ftag
else
- popTags = status.btag
+ popTags = btag
end
popTags[tag] = popTags[tag] - 1
end
diff --git a/script/files.lua b/script/files.lua
index 517cd03d..d99f6473 100644
--- a/script/files.lua
+++ b/script/files.lua
@@ -192,14 +192,19 @@ function m.setText(uri, text, isTrust)
end
end
- await.call(function ()
- await.close('update:' .. originUri)
- await.setID('update:' .. originUri)
- await.delay()
- if m.exists(originUri) then
- m.onWatch('update', originUri)
- end
- end)
+ if TEST then
+ m.onWatch('update', originUri)
+ else
+ await.call(function ()
+ await.close('update:' .. originUri)
+ await.setID('update:' .. originUri)
+ await.delay()
+ if m.exists(originUri) then
+ m.onWatch('update', originUri)
+ end
+ end)
+ end
+
end
function m.setRawText(uri, text)
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index 85bdec27..4535494c 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -1010,7 +1010,7 @@ function m.isGlobal(source)
local node = source.node
if node.special == 'rawget'
or node.special == 'rawset' then
- if source.args[1] then
+ if source.args and source.args[1] then
local isGlobal = source.args[1].special == '_G'
source._isGlobal = isGlobal
return isGlobal
diff --git a/test/full/projects.lua b/test/full/projects.lua
index 54192ee7..06085e47 100644
--- a/test/full/projects.lua
+++ b/test/full/projects.lua
@@ -40,4 +40,4 @@ local function doProjects(pathname)
end
--doProjects [[C:\SSSEditor\client\Output\Lua]]
---doProjects [[C:\W3-Server\script]]
+doProjects [[C:\W3-Server\script]]