diff options
Diffstat (limited to 'script/core/searcher.lua')
-rw-r--r-- | script/core/searcher.lua | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/script/core/searcher.lua b/script/core/searcher.lua index f2b9b291..4ce89fd1 100644 --- a/script/core/searcher.lua +++ b/script/core/searcher.lua @@ -775,7 +775,8 @@ function m.searchRefsByID(status, suri, expect, mode) local crossed = {} if mode == 'def' or mode == 'alldef' - or field then + or field + or hasCall(field) then for _, guri in ceach('def:' .. id) do if uri == guri then goto CONTINUE @@ -783,6 +784,15 @@ function m.searchRefsByID(status, suri, expect, mode) searchID(guri, id, field, uri) ::CONTINUE:: end + elseif mode == 'field' + or mode == 'allfield' then + for _, guri in ceach('field:' .. id) do + if uri == guri then + goto CONTINUE + end + searchID(guri, id, field, uri) + ::CONTINUE:: + end else for _, guri in ceach(id) do if crossed[guri] then @@ -929,9 +939,9 @@ function m.searchRefsByID(status, suri, expect, mode) end local stepCount = 0 - local stepMaxCount = 1e4 + local stepMaxCount = 1e3 if mode == 'allref' or mode == 'alldef' then - stepMaxCount = 1e5 + stepMaxCount = 1e4 end function searchStep(uri, id, field) |