From 94c2d83c8695cb1440d9682c3edb6feca0f5c02c Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 6 Jun 2024 22:32:27 +0200 Subject: [PATCH] nvim: Fix trouble for major version update Fixed for new invocation usage and removed deprecated commands. Added telescope functionality (to push results into trouble) though I am not quite happy with the close coupling yet. Have not found an easy way to only have this mapping be created if trouble exists. --- nvim/.config/nvim/lua/plugins/ide.lua | 7 ++----- nvim/.config/nvim/lua/plugins/telescope.lua | 5 +++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins/ide.lua b/nvim/.config/nvim/lua/plugins/ide.lua index c13ff31..21dec00 100644 --- a/nvim/.config/nvim/lua/plugins/ide.lua +++ b/nvim/.config/nvim/lua/plugins/ide.lua @@ -235,13 +235,10 @@ return { opts = {}, cmd = { "Trouble", - "TroubleRefresh", - "TroubleToggle", - "TroubleClose", }, keys = { - { "sd", "Trouble workspace_diagnostics", silent = true, desc = "diagnostics workspace" }, - { "sD", "Trouble document_diagnostics", silent = true, desc = "diagnostics document" }, + { "sd", "Trouble diagnostics toggle", silent = true, desc = "diagnostics workspace" }, + { "sD", "Trouble diagnostics toggle filter.buf=0", silent = true, desc = "diagnostics document" }, }, }, diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index 08fa63c..a32bf82 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -36,6 +36,11 @@ return { prompt_prefix = "󰍉 ", selection_caret = "󰳟 ", color_devicons = true, + mappings = { + -- FIXME Find way to only invoke this *IF* trouble plugin is found + i = { [""] = require("trouble.sources.telescope").open }, + n = { [""] = require("trouble.sources.telescope").open }, + } }, pickers = { buffers = { theme = "ivy" },