diff options
-rw-r--r-- | server/src/path_filter.lua | 11 | ||||
-rw-r--r-- | server/src/workspace.lua | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/server/src/path_filter.lua b/server/src/path_filter.lua index fb39a6f8..403c938c 100644 --- a/server/src/path_filter.lua +++ b/server/src/path_filter.lua @@ -1,6 +1,6 @@ local m = require 'lpeglabel' -local m_cut = m.S'/\\' +local m_cut = m.S'\\' local m_path = (1-m_cut)^1 local function match_any(p, pass) @@ -20,16 +20,17 @@ local function compile_format(fmt) end local function compile_exp(exp) - if exp:sub(1, 1) == '/' then + exp = exp:gsub('/', '\\') + if exp:sub(1, 1) == '\\' then exp = exp:sub(2) else - exp = '**/' .. exp + exp = '**\\' .. exp end - if exp:sub(-1) == '/' then + if exp:sub(-1) == '\\' then exp = exp:sub(1, -2) end local function next(cur) - local pos, fn = exp:find('[/\\]+', cur) + local pos, fn = exp:find('[\\]+', cur) if not pos then return compile_format(exp:sub(cur)) end diff --git a/server/src/workspace.lua b/server/src/workspace.lua index 034a057c..c02f2854 100644 --- a/server/src/workspace.lua +++ b/server/src/workspace.lua @@ -78,9 +78,7 @@ function mt:init(rootUri) log.info('Log path: ', logPath) log.init(ROOT, logPath) - local ignored = { - ['.git'] = true, - } + local ignored = {'.git'} for path in pairs(config.config.workspace.ignoreDir) do ignored[#ignored+1] = path end |