From 672bec919c9199b9d70856b04620a05f3a03bf58 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, 25 Nov 2020 15:53:04 +0800 Subject: #269 workspace.library should be normalized first --- script/workspace/workspace.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'script') diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index c5744666..31828245 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -134,10 +134,10 @@ function m.getLibraryMatchers() local librarys = {} for path, pattern in pairs(config.config.workspace.library) do - librarys[path] = pattern + librarys[m.normalize(path)] = pattern end if library.metaPath then - librarys[library.metaPath] = true + librarys[m.normalize(library.metaPath)] = true end m.libraryMatchers = {} for path, pattern in pairs(librarys) do @@ -294,11 +294,13 @@ end function m.normalize(path) if platform.OS == 'Windows' then path = path:gsub('[/\\]+', '\\') + :gsub('[/\\]+$', '') :gsub('^%a+%:', function (str) return str:upper() end) else path = path:gsub('[/\\]+', '/') + :gsub('[/\\]+$', '') end return path:gsub('^[/\\]+', '') end -- cgit v1.2.3