From 714ed755c59df5ce52f7bda515fc0e2c555aa5af Mon Sep 17 00:00:00 2001 From: diniamo Date: Sun, 10 Nov 2024 19:52:12 +0100 Subject: [PATCH] trouble: fix binds --- modules/extra/deprecations.nix | 5 +++++ modules/plugins/lsp/trouble/config.nix | 15 +++++++-------- modules/plugins/lsp/trouble/trouble.nix | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix index 5a30ef5..a4ac56a 100644 --- a/modules/extra/deprecations.nix +++ b/modules/extra/deprecations.nix @@ -54,5 +54,10 @@ in { Nvf now uses $NVIM_APP_NAME so there is no longer the problem of (accidental) leaking of user configuration. '') + + (mkRemovedOptionModule ["vim" "lsp" "trouble" "mappings" "toggle"] '' + With Trouble having so many different modes, and breaking changes + upstream, it no longer makes sense, nor works, to toggle only Trouble. + '') ]; } diff --git a/modules/plugins/lsp/trouble/config.nix b/modules/plugins/lsp/trouble/config.nix index cae0c7a..86b307f 100644 --- a/modules/plugins/lsp/trouble/config.nix +++ b/modules/plugins/lsp/trouble/config.nix @@ -21,19 +21,18 @@ in { cmd = "Trouble"; keys = [ - (mkSetLznBinding mappings.toggle "TroubleToggle") - (mkSetLznBinding mappings.workspaceDiagnostics "TroubleToggle workspace_diagnostics") - (mkSetLznBinding mappings.documentDiagnostics "TroubleToggle document_diagnostics") - (mkSetLznBinding mappings.lspReferences "TroubleToggle lsp_references") - (mkSetLznBinding mappings.quickfix "TroubleToggle quickfix") - (mkSetLznBinding mappings.locList "TroubleToggle loclist") + (mkSetLznBinding mappings.workspaceDiagnostics "Trouble toggle diagnostics") + (mkSetLznBinding mappings.documentDiagnostics "Trouble toggle diagnostics filter.buf=0") + (mkSetLznBinding mappings.lspReferences "Trouble toggle lsp_references") + (mkSetLznBinding mappings.quickfix "Trouble toggle quickfix") + (mkSetLznBinding mappings.locList "Trouble toggle loclist") + (mkSetLznBinding mappings.symbols "Trouble toggle symbols") ]; }; binds.whichKey.register = pushDownDefault { - "l" = "Trouble"; "x" = "+Trouble"; - "lw" = "Workspace"; + "lw" = "+Workspace"; }; }; }; diff --git a/modules/plugins/lsp/trouble/trouble.nix b/modules/plugins/lsp/trouble/trouble.nix index 04bd506..5fa5a3d 100644 --- a/modules/plugins/lsp/trouble/trouble.nix +++ b/modules/plugins/lsp/trouble/trouble.nix @@ -10,12 +10,12 @@ in { setupOpts = mkPluginSetupOption "Trouble" {}; mappings = { - toggle = mkMappingOption "Toggle trouble [trouble]" "xx"; workspaceDiagnostics = mkMappingOption "Workspace diagnostics [trouble]" "lwd"; documentDiagnostics = mkMappingOption "Document diagnostics [trouble]" "ld"; lspReferences = mkMappingOption "LSP References [trouble]" "lr"; quickfix = mkMappingOption "QuickFix [trouble]" "xq"; locList = mkMappingOption "LOCList [trouble]" "xl"; + symbols = mkMappingOption "Symbols [trouble]" "xs"; }; }; };