aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2021-07-09 17:54:42 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2021-07-09 17:54:42 +0200
commit5487e6b9a5afc852e1cb757157e386a4658a8a82 (patch)
tree0b86e0a8b0d4bf5c20878eb3576099b93680b503
parentbfcd8ce5955b282c635d4858aa9bb62981ed67a1 (diff)
downloadvis-lspc-0.1.2.tar.gz
vis-lspc-0.1.2.zip
Automatically open current file when showing diagnosticsv0.1.2
This is more consistent with the other lspc functions.
-rw-r--r--init.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 3d2bef9..8986139 100644
--- a/init.lua
+++ b/init.lua
@@ -937,11 +937,12 @@ local lspc_goto_location_methods = {
}
local function lspc_show_diagnostic(ls, win, line)
- local open_file = ls.open_files[win.file.path]
- if not open_file then
- return win.file.path .. ' not open in ' .. ls.name
+ if not ls.open_files[win.file.path] then
+ lspc_open(ls, win, win.file)
end
+ local open_file = ls.open_files[win.file.path]
+
local diagnostics = open_file.diagnostics
if not diagnostics then
return win.file.path .. ' has no diagnostics available'