File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -55,13 +55,24 @@ _G._toggle_inlayhint = function()
5555 )
5656end
5757
58- local _vt_enabled = require (" core.settings" ).diagnostics_virtual_text
5958_G ._toggle_virtualtext = function ()
60- if vim .diagnostic .is_enabled () then
61- _vt_enabled = not _vt_enabled
62- vim .diagnostic [_vt_enabled and " show" or " hide" ]()
59+ local _vt_enabled = require (" core.settings" ).diagnostics_virtual_text
60+ if _vt_enabled then
61+ local vt_config = not vim .diagnostic .config ().virtual_text
62+ vim .diagnostic .config ({ virtual_text = vt_config })
6363 vim .notify (
64- (_vt_enabled and " Virtual text is now displayed" or " Virtual text is now hidden" ),
64+ (vt_config and " Virtual text is now displayed" or " Virtual text is now hidden" ),
65+ vim .log .levels .INFO ,
66+ { title = " LSP Diagnostic" }
67+ )
68+ end
69+
70+ local _vl_enabled = require (" core.settings" ).diagnostics_virtual_lines
71+ if _vl_enabled then
72+ local vl_config = not vim .diagnostic .config ().virtual_lines
73+ vim .diagnostic .config ({ virtual_lines = vl_config })
74+ vim .notify (
75+ (vl_config and " Virtual lines is now displayed" or " Virtual lines is now hidden" ),
6576 vim .log .levels .INFO ,
6677 { title = " LSP Diagnostic" }
6778 )
You can’t perform that action at this time.
0 commit comments