fix: case handling for LSP willRenameFiles

This commit is contained in:
Steven Arcangeli 2023-10-01 16:47:22 -07:00
parent 8f3c1d2d2e
commit deba4db1ac

View file

@ -13,13 +13,16 @@ local function file_matches(filepath, pattern)
return false return false
end end
end end
local pat = vim.fn.glob2regpat(pattern.glob)
if vim.tbl_get(pattern, "options", "ignoreCase") then if vim.tbl_get(pattern, "options", "ignoreCase") then
filepath = filepath:lower() pat = "\\c" .. pat
pattern.glob = pattern.glob:lower()
end end
local pat = vim.fn.glob2regpat(pattern.glob) local ignorecase = vim.o.ignorecase
return vim.fn.match(filepath, pat) >= 0 vim.o.ignorecase = false
local match = vim.fn.match(filepath, pat) >= 0
vim.o.ignorecase = ignorecase
return match
end end
---@param filepath string ---@param filepath string