From 83583e9b6477ec92bceba56fa3ef7f4f325c33e9 Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Mon, 6 May 2024 16:05:43 -0400 Subject: [PATCH 1/2] plugins/lsp: filter out null mappings --- modules/plugins/lsp/config.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/plugins/lsp/config.nix b/modules/plugins/lsp/config.nix index ba93b28..d91a4fb 100644 --- a/modules/plugins/lsp/config.nix +++ b/modules/plugins/lsp/config.nix @@ -16,7 +16,10 @@ mappingDefinitions = self.options.vim.lsp.mappings; mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; - mkBinding = binding: action: "vim.api.nvim_buf_set_keymap(bufnr, 'n', '${binding.value}', 'lua ${action}', {noremap=true, silent=true, desc='${binding.description}'})"; + mkBinding = binding: action: + if binding.value != null + then "vim.api.nvim_buf_set_keymap(bufnr, 'n', '${binding.value}', 'lua ${action}', {noremap=true, silent=true, desc='${binding.description}'})" + else ""; in { config = mkIf cfg.enable { vim = { From dc0fa7629564f9481b03a4be358557868befa0a4 Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Mon, 6 May 2024 17:01:16 -0400 Subject: [PATCH 2/2] docs: entry for fixed null lsp mappings --- docs/release-notes/rl-0.7.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/rl-0.7.md b/docs/release-notes/rl-0.7.md index ab6f9da..3582cd2 100644 --- a/docs/release-notes/rl-0.7.md +++ b/docs/release-notes/rl-0.7.md @@ -13,7 +13,8 @@ Release notes for release 0.7 - Modified type for [](#opt-vim.visuals.fidget-nvim.setupOpts.progress.display.overrides) from `anything` to a `submodule` for better type checking. +- Fix null `vim.lsp.mappings` generating an error and not being filtered out. -[horriblename](https://github.com/horriblename) +[horriblename](https://github.com/horriblename): - Fix broken treesitter-context keybinds in visual mode