From c7e90a01ac98855a104cbb9cbd6ce35f3f26e4ff Mon Sep 17 00:00:00 2001 From: Jannik Donker Date: Fri, 19 Jun 2026 18:41:38 +0200 Subject: [PATCH] trouble panel fixes (empty diagnostics and todo) --- lua/keymaps.lua | 2 +- lua/plugins.lua | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 864d06e..2f698c5 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -29,7 +29,7 @@ map("n", "xx", "Trouble diagnostics toggle focus=true", { desc = "Trouble: workspace diagnostics" }) map("n", "xX", "Trouble diagnostics toggle filter.buf=0 focus=true", { desc = "Trouble: buffer diagnostics" }) -map("n", "xt", "Trouble todo toggle", { desc = "Trouble: todo list" }) +map("n", "xt", "Trouble todo toggle focus=true", { desc = "Trouble: todo list" }) -- Pickers / files map("n", "", "Pick files", { desc = "Find: files" }) diff --git a/lua/plugins.lua b/lua/plugins.lua index c9c0d27..22e0cfe 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -19,6 +19,7 @@ vim.pack.add({ { src = "https://codeberg.org/mfussenegger/nvim-dap.git" }, { src = "https://github.com/echasnovski/mini.ai" }, { src = "https://github.com/windwp/nvim-ts-autotag" }, + { src = "https://github.com/nvim-lua/plenary.nvim" }, { src = "https://github.com/folke/todo-comments.nvim" }, { src = "https://github.com/stevearc/conform.nvim" }, { src = "https://github.com/lewis6991/gitsigns.nvim" }, @@ -37,11 +38,15 @@ pcall(vim.cmd.colorscheme, "gruvbox") -- Simple setup({}) plugins for _, name in ipairs({ "oil", "mini.pick", "mini.extra", "mini.icons", "mason", "typst-preview", - "nvim-autopairs", "trouble", "gitsigns", "mini.jump", + "nvim-autopairs", "gitsigns", "mini.jump", "mini.ai", "nvim-ts-autotag", "todo-comments", "csvview", }) do pcall(function() require(name).setup() end) end + +-- Open the Trouble window even when there are no results (e.g. no +-- diagnostics) instead of erroring out with "No results". +require("trouble").setup({ open_no_results = true }) require("mini.icons").mock_nvim_web_devicons() -- Labeled jump-anywhere motion (flash replacement); trigger with j.