aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorGregory Anders <greg@gpanders.com>2025-01-18 07:43:21 -0600
committerGitHub <noreply@github.com>2025-01-18 07:43:21 -0600
commit51ccd12b3dbc50300e83f503426abbcb605efcea (patch)
treeace2031735df7a7dc227deb33efd05a477eff7cb /runtime
parent954d4969c991be1a758c121be6f7d811b5e5cea1 (diff)
downloadrneovim-51ccd12b3dbc50300e83f503426abbcb605efcea.tar.gz
rneovim-51ccd12b3dbc50300e83f503426abbcb605efcea.tar.bz2
rneovim-51ccd12b3dbc50300e83f503426abbcb605efcea.zip
fix(diagnostic)!: make virtual text handler opt-in (#32079)
Making this opt-out (on by default) was the wrong choice from the beginning. It is too visually noisy to be enabled by default. BREAKING CHANGE: Users must opt-in to the diagnostic virtual text handler by adding vim.diagnostic.config({ virtual_text = true }) to their config.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/diagnostic.txt2
-rw-r--r--runtime/doc/news.txt4
-rw-r--r--runtime/lua/vim/diagnostic.lua4
3 files changed, 6 insertions, 4 deletions
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index 7d97a18437..d4939d8cc7 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -464,7 +464,7 @@ Lua module: vim.diagnostic *diagnostic-api*
Fields: ~
• {underline}? (`boolean|vim.diagnostic.Opts.Underline|fun(namespace: integer, bufnr:integer): vim.diagnostic.Opts.Underline`, default: `true`)
Use underline for diagnostics.
- • {virtual_text}? (`boolean|vim.diagnostic.Opts.VirtualText|fun(namespace: integer, bufnr:integer): vim.diagnostic.Opts.VirtualText`, default: `true`)
+ • {virtual_text}? (`boolean|vim.diagnostic.Opts.VirtualText|fun(namespace: integer, bufnr:integer): vim.diagnostic.Opts.VirtualText`, default: `false`)
Use virtual text for diagnostics. If multiple
diagnostics are set for a namespace, one prefix
per diagnostic + the last diagnostic message are
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 33ffeae2bb..ef97957d22 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -70,7 +70,9 @@ DIAGNOSTICS
the "severity_sort" option.
• Diagnostics are filtered by severity before being passed to a diagnostic
handler |diagnostic-handlers|.
-
+• The "virtual_text" handler is disabled by default. Enable with >lua
+ vim.diagnostic.config({ virtual_text = true })
+<
EDITOR
• The order in which signs are placed was changed. Higher priority signs will
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua
index 0939ff591e..ead75f7d51 100644
--- a/runtime/lua/vim/diagnostic.lua
+++ b/runtime/lua/vim/diagnostic.lua
@@ -70,7 +70,7 @@ end
--- Use virtual text for diagnostics. If multiple diagnostics are set for a
--- namespace, one prefix per diagnostic + the last diagnostic message are
--- shown.
---- (default: `true`)
+--- (default: `false`)
--- @field virtual_text? boolean|vim.diagnostic.Opts.VirtualText|fun(namespace: integer, bufnr:integer): vim.diagnostic.Opts.VirtualText
---
--- Use signs for diagnostics |diagnostic-signs|.
@@ -312,7 +312,7 @@ M.severity = {
local global_diagnostic_options = {
signs = true,
underline = true,
- virtual_text = true,
+ virtual_text = false,
float = true,
update_in_insert = false,
severity_sort = false,