aboutsummaryrefslogtreecommitdiffstats
path: root/nvim/lua/plugins/diagnostics.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nvim/lua/plugins/diagnostics.lua')
-rw-r--r--nvim/lua/plugins/diagnostics.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/nvim/lua/plugins/diagnostics.lua b/nvim/lua/plugins/diagnostics.lua
index 78c3f02..7865470 100644
--- a/nvim/lua/plugins/diagnostics.lua
+++ b/nvim/lua/plugins/diagnostics.lua
@@ -13,7 +13,11 @@ return {
follow = false
}
if trouble.is_open(opts) then
- trouble.close(opts)
+ if vim.o.ft == "trouble" then
+ trouble.close(opts)
+ else
+ trouble.focus()
+ end
else
trouble.open(opts)
end
@@ -30,11 +34,14 @@ return {
follow = false,
filter = { buf = 0 }
}
- if not trouble.is_open(opts) then
- trouble.open(opts)
- trouble.focus(opts)
+ if trouble.is_open(opts) then
+ if vim.o.ft == "trouble" then
+ trouble.close(opts)
+ else
+ trouble.focus()
+ end
else
- trouble.close(opts)
+ trouble.open(opts)
end
end,
desc = "Buffer Diagnostics (Trouble)",