Skip to content

Commit

Permalink
Merge pull request #287 from FrothyMarrow/mappings-fix
Browse files Browse the repository at this point in the history
plugins/lsp: filter out null mappings
  • Loading branch information
NotAShelf authored May 6, 2024
2 parents efd8b44 + dc0fa76 commit 12fd9d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/release-notes/rl-0.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion modules/plugins/lsp/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}', '<cmd>lua ${action}<CR>', {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}', '<cmd>lua ${action}<CR>', {noremap=true, silent=true, desc='${binding.description}'})"
else "";
in {
config = mkIf cfg.enable {
vim = {
Expand Down

0 comments on commit 12fd9d6

Please sign in to comment.