From c4cc8240f1c71defcb67c45da96e44b968d29e5f Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Sun, 7 Jan 2024 12:12:34 -0800 Subject: [PATCH] fix: crash when LSP client workspace_folders is nil (#269) --- lua/oil/lsp/workspace.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/oil/lsp/workspace.lua b/lua/oil/lsp/workspace.lua index 2e67f69a..91567feb 100644 --- a/lua/oil/lsp/workspace.lua +++ b/lua/oil/lsp/workspace.lua @@ -98,7 +98,7 @@ local function get_matching_paths(client, filters, paths) local workspace_folders = vim.tbl_map(function(folder) return vim.uri_to_fname(folder.uri) - end, client.workspace_folders) + end, client.workspace_folders or {}) local function get_matching_workspace(path) for _, workspace in ipairs(workspace_folders) do if fs.is_subpath(workspace, path) then