aboutsummaryrefslogtreecommitdiffstats
path: root/nvim/lua/plugins/diagnostics.lua
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2024-08-17 03:30:07 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2024-08-17 03:30:07 -0400
commitc840e6608751f1e15a2cd6347924186b27fbe842 (patch)
tree6db407743e9d41a635db17720c7f82128146325f /nvim/lua/plugins/diagnostics.lua
parent0089c3d186cd54de4827b58e43f3ae9e0255d55f (diff)
improved Trouble.nvim config, ensure Go treesitter parser
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)",