Closed vloth closed 2 years ago
Hey @vloth thanks for your contrib, but this looks like something that only works on 0.5.1 and previous versions Reading the docs I checked that this symbols are now named as DiagnosticSign(something) like:
(vim.fn.sign_define "DiagnosticSignError" {:text "" :texthl "DiagnosticSignError"})
(vim.fn.sign_define "DiagnosticSignWarn" {:text "" :texthl "DiagnosticSignWarn"})
(vim.fn.sign_define "DiagnosticSignInfo" {:text "" :texthl "DiagnosticSignInfo"})
(vim.fn.sign_define "DiagnosticSignHint" {:text "" :texthl "DiagnosticSignHint"})
Could you test if this works on 0.5.1?
Hi, yes! I just tested here, but it doesn't work unfortunately
I could update the PR to include both versions or branch based on user's version. Any thoughts?
The idea of version handling looks good, but I have no idea how to do
I played a little bit with the api and came up with the following:
(defn define-signs
[prefix]
(let [error (.. prefix "SignError")
warn (.. prefix "SignWarn")
info (.. prefix "SignInfo")
hint (.. prefix "SignHint")]
(vim.fn.sign_define error {:text "x" :texthl error})
(vim.fn.sign_define warn {:text "!" :texthl warn})
(vim.fn.sign_define info {:text "i" :texthl info})
(vim.fn.sign_define hint {:text "?" :texthl hint})))
(if (= (nvim.fn.has "nvim-0.6") 1)
(define-signs "Diagnostic")
(define-signs "LspDiagnostics"))
Probably not the most elegant solution, but seems to get the job done. What do you think?
LGTM! :smile:
Hi, I've pushed the commit with the change mentioned above. Could you see if it works on v0.6 too?
Works great! Thanks for your contribution!!
I noticed the lsp signs weren't being coloured. This changeset should restore their default color, that's how it looks in my setup now: