fix: case handling for LSP willRenameFiles
This commit is contained in:
parent
8f3c1d2d2e
commit
deba4db1ac
1 changed files with 7 additions and 4 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue