From b4911faeada96b0437ee406dc269035bf56d4759 Mon Sep 17 00:00:00 2001 From: Noah Friedman Date: Tue, 2 Jul 2024 10:39:56 -0400 Subject: [PATCH 1/2] Fix issue where `util.workspace` tries extend nil Adds a check for if the current buffer's action map is `nil` in the `util.workspace` function. If it is, the function coalesces the value into an empty table. --- lua/spLauncher/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/spLauncher/util.lua b/lua/spLauncher/util.lua index 4caa522..c91ff2d 100644 --- a/lua/spLauncher/util.lua +++ b/lua/spLauncher/util.lua @@ -11,7 +11,7 @@ function M.workspace(lsp, config, bufnr) local client = vim.lsp.get_client_by_id(args.data.client_id) if client and client.name == lsp and client.config.root_dir ~= nil and client.config.root_dir ~= "" then - vim.b[args.buf].spLauncherActionMap = vim.tbl_deep_extend("force", vim.b[args.buf].spLauncherActionMap, + vim.b[args.buf].spLauncherActionMap = vim.tbl_deep_extend("force", vim.b[args.buf].spLauncherActionMap or {}, type(config) == "function" and config(client.config.root_dir) or config) end From 11bc3e35e34124b53b90896f9b67838b94aba84e Mon Sep 17 00:00:00 2001 From: Noah Friedman Date: Tue, 2 Jul 2024 10:50:57 -0400 Subject: [PATCH 2/2] Add changes for v0.3.2 to changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ebb350..d1471b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### [0.3.2](https://github.com/speelbarrow/spLauncher.nvim/tree/v0.3.2) +- Fix issue where [`util.workspace`]( +https://github.com/speelbarrow/spLauncher.nvim/blob/b4911faeada96b0437ee406dc269035bf56d4759/lua/spLauncher/util.lua#L7) +would try to [`vim.tbl_deep_extend`](https://neovim.io/doc/user/lua.html#vim.tbl_deep_extend()) a nil value ([b4911fa]( +https://github.com/speelbarrow/spLauncher.nvim/commit/b4911faeada96b0437ee406dc269035bf56d4759)) + ### [0.3.1](https://github.com/speelbarrow/spLauncher.nvim/tree/v0.3.1) - Update default action keybindings ([ccd6f5c]( https://github.com/speelbarrow/spLauncher.nvim/commit/ccd6f5c1b692c68802ae7a88bb53fa76e52b3c49))