diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-04-20 16:05:16 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-04-20 16:05:16 +0800 |
commit | 9a1307a9147ef8956db9cdc37e42f057d24c3db1 (patch) | |
tree | 133f24d4d69dda91bb38a8a8c08dd4481304a34d /script | |
parent | 6df0f180687cc1e9d7589281c1ca37659145f508 (diff) | |
download | lua-language-server-9a1307a9147ef8956db9cdc37e42f057d24c3db1.zip |
backward tablefield
Diffstat (limited to 'script')
-rw-r--r-- | script/core/guide.lua | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/script/core/guide.lua b/script/core/guide.lua index c7901448..9e75936a 100644 --- a/script/core/guide.lua +++ b/script/core/guide.lua @@ -108,12 +108,24 @@ function m.searchRefs(status, source, mode) local search + local function checkLastID(id, field, flag) + local lastID = linker.getLastID(root, id) + if lastID then + local newField = id:sub(#lastID + 1) + if field then + newField = newField .. field + end + search(lastID, newField, flag) + end + end + local function searchSource(obj, field, flag) local link = linker.getLink(obj) if not link then return end local id = link.id + checkLastID(id, field, flag) if field then id = id .. field end @@ -186,17 +198,6 @@ function m.searchRefs(status, source, mode) end end - local function checkLastID(id, field, flag) - local lastID = linker.getLastID(root, id) - if lastID then - local newField = id:sub(#lastID + 1) - if field then - newField = newField .. field - end - search(lastID, newField, flag) - end - end - local stackCount = 0 local mark = {} search = function (id, field, flag) @@ -220,7 +221,6 @@ function m.searchRefs(status, source, mode) checkForward(eachLink, field, flag | SEARCH_FLAG.forward) checkBackward(eachLink, field, flag | SEARCH_FLAG.backward) end - checkLastID(id, field, flag) stackCount = stackCount - 1 end |