aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-10-08 10:18:27 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2023-10-12 18:50:20 +0200
commit1d9b9603bb98a0cd0fc8240cbe0a7989bf785db0 (patch)
tree3636915b196aac0f0977e5ca1b5b04dc76dc24e0
parent067ec7dd2d5006af72aa73a4fada5380da5c0126 (diff)
downloadvis-lspc-1d9b9603bb98a0cd0fc8240cbe0a7989bf785db0.tar.gz
vis-lspc-1d9b9603bb98a0cd0fc8240cbe0a7989bf785db0.zip
report if no diagnostics are available
Since the diagnostics table is created when we open the file it will always be ~= nil.
-rw-r--r--init.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index ca8c5b6..e05d5ae 100644
--- a/init.lua
+++ b/init.lua
@@ -1319,7 +1319,7 @@ local function lspc_show_diagnostic(ls, win, line)
local open_file = ls.open_files[win.file.path]
local diagnostics = open_file.diagnostics
- if not diagnostics then
+ if not diagnostics or #diagnostics == 0 then
return win.file.path .. ' has no diagnostics available'
end