Skip to content

Commit

Permalink
fix(lsp_rename): handle absolute path glob filters (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jan 16, 2024
1 parent e71b6ca commit ec24334
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lua/oil/lsp/workspace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,8 @@ local function get_matching_paths(client, filters, paths)
local function match_any_pattern(workspace, path)
local relative_path = path:sub(workspace:len() + 2)
for _, match_fn in ipairs(match_fns) do
if match_fn(relative_path) then
return true
end
-- nvim 0.9 doesn't have full glob support, so we need to check the full path as well as the
-- relative path because `**/*.ts` won't match `foo.ts`
if vim.fn.has("nvim-0.10") == 0 and match_fn(path) then
-- The glob pattern might be relative to workspace OR absolute
if match_fn(relative_path) or match_fn(path) then
return true
end
end
Expand Down

0 comments on commit ec24334

Please sign in to comment.