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
|
||||
end
|
||||
end
|
||||
local pat = vim.fn.glob2regpat(pattern.glob)
|
||||
if vim.tbl_get(pattern, "options", "ignoreCase") then
|
||||
filepath = filepath:lower()
|
||||
pattern.glob = pattern.glob:lower()
|
||||
pat = "\\c" .. pat
|
||||
end
|
||||
|
||||
local pat = vim.fn.glob2regpat(pattern.glob)
|
||||
return vim.fn.match(filepath, pat) >= 0
|
||||
local ignorecase = vim.o.ignorecase
|
||||
vim.o.ignorecase = false
|
||||
local match = vim.fn.match(filepath, pat) >= 0
|
||||
vim.o.ignorecase = ignorecase
|
||||
return match
|
||||
end
|
||||
|
||||
---@param filepath string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue