From 33b75938b2d7cf77216f81f345db7ad29edaa2a2 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 22 Apr 2024 10:07:53 -0500 Subject: [PATCH] feat(nvim): add bind to focus on trouble window --- dots/.config/nvim/lua/plugins/configs/trouble.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dots/.config/nvim/lua/plugins/configs/trouble.lua b/dots/.config/nvim/lua/plugins/configs/trouble.lua index 135c54f7..09e85b34 100644 --- a/dots/.config/nvim/lua/plugins/configs/trouble.lua +++ b/dots/.config/nvim/lua/plugins/configs/trouble.lua @@ -36,7 +36,17 @@ return { "Trouble lsp_type_definitions toggle win.position=right", desc = "LSP: Type Definitions", }, - { "xx", "Trouble lsp toggle win.position=right", desc = "Trouble: LSP" }, + { + "xx", + function() + local trouble = require("trouble") + if trouble.is_open() then + ---@diagnostic disable-next-line: missing-parameter + trouble.focus() + end + end, + desc = "Trouble: Focus Trouble", + }, { "xd", "Trouble diagnostics toggle win.position=right", @@ -59,7 +69,6 @@ return { opts = { focus = true, auto_close = true, - max_items = 2000, win = { type = "split", },