From 118d331f111c4ea6822b8d01469209aeb7d6dd04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 13 Jan 2022 11:50:54 +0800 Subject: require hover use relative path --- script/core/hover/description.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'script') diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua index c46b239d..0cb5377f 100644 --- a/script/core/hover/description.lua +++ b/script/core/hover/description.lua @@ -24,11 +24,7 @@ local function collectRequire(mode, literal, uri) local shows = {} for i, uri in ipairs(result) do local searcher = searchers and searchers[uri] - local path = furi.decode(uri) - if path:sub(1, #rootPath) == rootPath then - path = path:sub(#rootPath + 1) - end - path = path:gsub('^[/\\]*', '') + local path = ws.getRelativePath(uri) if vm.isMetaFile(uri) then shows[i] = ('* [[meta]](%s)'):format(uri) elseif searcher then -- cgit v1.2.3