From deba4db1aca6e3970c94499401da001694d01138 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Sun, 1 Oct 2023 16:47:22 -0700 Subject: [PATCH] fix: case handling for LSP willRenameFiles --- lua/oil/lsp_helpers.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lua/oil/lsp_helpers.lua b/lua/oil/lsp_helpers.lua index 3c3f784..e6a8d2d 100644 --- a/lua/oil/lsp_helpers.lua +++ b/lua/oil/lsp_helpers.lua @@ -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