aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/options.txt9
-rw-r--r--runtime/doc/various.txt10
-rw-r--r--runtime/lua/vim/diagnostic.lua8
-rw-r--r--runtime/lua/vim/lsp/diagnostic.lua28
-rw-r--r--runtime/plugin/diagnostic.vim22
5 files changed, 21 insertions, 56 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 4eb367258f..cc7524988d 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -435,6 +435,15 @@ chance that a normal word like "lex:" is caught. There is one exception:
version 3.0). Using "ex:" at the start of the line will be ignored (this
could be short for "example:").
+If the modeline is disabled within a modeline, subsequent modelines will be
+ignored. This is to allow turning off modeline on a per-file basis. This is
+useful when a line looks like a modeline but isn't. For example, it would be
+good to start a YAML file containing strings like "vim:" with
+ # vim: nomodeline ~
+so as to avoid modeline misdetection. Following options on the same line
+after modeline deactivation, if any, are still evaluated (but you would
+normally not have any).
+
*modeline-local*
The options are set like with ":setlocal": The new value only applies to the
buffer and window that contain the file. Although it's possible to set global
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index 29bd6e5e64..b06fa7518c 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -166,9 +166,13 @@ g8 Print the hex values of the bytes used in the
If the mark is "=", a line of dashes is printed
around the current line.
-:[range]z#[+-^.=][count] *:z#*
- Like ":z", but number the lines.
- {not in all versions of Vi, not with these arguments}
+ *:z!*
+:[range]z![+-^.=][count]
+ Like ":z:", but when [count] is not specified, it
+ defaults to the Vim window height minus one.
+
+:[range]z[!]#[+-^.=][count] *:z#*
+ Like ":z" or ":z!", but number the lines.
*:=*
:= [flags] Print the last line number.
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua
index 33fa07ef4c..688f9b5811 100644
--- a/runtime/lua/vim/diagnostic.lua
+++ b/runtime/lua/vim/diagnostic.lua
@@ -523,7 +523,7 @@ end
--- Get current diagnostics.
---
----@param bufnr number|nil Buffer number to get diagnistics from. Use 0 for
+---@param bufnr number|nil Buffer number to get diagnostics from. Use 0 for
--- current buffer or nil for all buffers.
---@param opts table|nil A table with the following keys:
--- - namespace: (number) Limit diagnostics to the given namespace.
@@ -631,7 +631,7 @@ local function diagnostic_move_pos(opts, pos)
local win_id = opts.win_id or vim.api.nvim_get_current_win()
if not pos then
- vim.api.nvim_echo({"No more valid diagnostics to move to", "WarningMsg"})
+ vim.api.nvim_echo({{"No more valid diagnostics to move to", "WarningMsg"}}, true, {})
return
end
@@ -1001,7 +1001,7 @@ end
--- Open a floating window with the diagnostics at the given position.
---
---@param opts table|nil Configuration table with the same keys as
---- |vim.lsp.util.open_floatin_preview()| in addition to the following:
+--- |vim.lsp.util.open_floating_preview()| in addition to the following:
--- - namespace: (number) Limit diagnostics to the given namespace
--- - severity: See |diagnostic-severity|.
--- - show_header: (boolean, default true) Show "Diagnostics:" header
@@ -1049,7 +1049,7 @@ function M.show_line_diagnostics(opts, bufnr, lnum)
opts = opts or {}
opts.focus_id = "line_diagnostics"
- opts.lnum = lnum
+ opts.lnum = lnum or (vim.api.nvim_win_get_cursor(0)[1] - 1)
local line_diagnostics = M.get(bufnr, opts)
return show_diagnostics(opts, line_diagnostics)
end
diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua
index 01c675ba77..eef840bee5 100644
--- a/runtime/lua/vim/lsp/diagnostic.lua
+++ b/runtime/lua/vim/lsp/diagnostic.lua
@@ -265,7 +265,7 @@ function M.get(bufnr, client_id, predicate)
table.insert(all_diagnostics, diagnostic)
end
end)
- return diagnostic_vim_to_lsp(all_diagnostics)
+ return all_diagnostics
end
local namespace = M.get_namespace(client_id)
@@ -446,14 +446,6 @@ end
---
---@deprecated Prefer |vim.diagnostic._set_signs()|
---
---- Sign characters can be customized with the following commands:
----
---- <pre>
---- sign define LspDiagnosticsSignError text=E texthl=LspDiagnosticsSignError linehl= numhl=
---- sign define LspDiagnosticsSignWarning text=W texthl=LspDiagnosticsSignWarning linehl= numhl=
---- sign define LspDiagnosticsSignInformation text=I texthl=LspDiagnosticsSignInformation linehl= numhl=
---- sign define LspDiagnosticsSignHint text=H texthl=LspDiagnosticsSignHint linehl= numhl=
---- </pre>
---@param diagnostics Diagnostic[]
---@param bufnr number The buffer number
---@param client_id number the client id
@@ -478,15 +470,6 @@ end
---
---@deprecated Prefer |vim.diagnostic._set_underline()|
---
---- Underline highlights can be customized by changing the following |:highlight| groups.
----
---- <pre>
---- LspDiagnosticsUnderlineError
---- LspDiagnosticsUnderlineWarning
---- LspDiagnosticsUnderlineInformation
---- LspDiagnosticsUnderlineHint
---- </pre>
----
---@param diagnostics Diagnostic[]
---@param bufnr number: The buffer number
---@param client_id number: The client id
@@ -506,15 +489,6 @@ end
---
---@deprecated Prefer |vim.diagnostic._set_virtual_text()|
---
---- Virtual text highlights can be customized by changing the following |:highlight| groups.
----
---- <pre>
---- LspDiagnosticsVirtualTextError
---- LspDiagnosticsVirtualTextWarning
---- LspDiagnosticsVirtualTextInformation
---- LspDiagnosticsVirtualTextHint
---- </pre>
----
---@param diagnostics Diagnostic[]
---@param bufnr number
---@param client_id number
diff --git a/runtime/plugin/diagnostic.vim b/runtime/plugin/diagnostic.vim
index 45d75b79bf..2183623ac8 100644
--- a/runtime/plugin/diagnostic.vim
+++ b/runtime/plugin/diagnostic.vim
@@ -24,25 +24,3 @@ hi default link DiagnosticSignError DiagnosticError
hi default link DiagnosticSignWarn DiagnosticWarn
hi default link DiagnosticSignInfo DiagnosticInfo
hi default link DiagnosticSignHint DiagnosticHint
-
-" Link LspDiagnostics for backward compatibility
-hi default link LspDiagnosticsDefaultHint DiagnosticHint
-hi default link LspDiagnosticsVirtualTextHint DiagnosticVirtualTextHint
-hi default link LspDiagnosticsFloatingHint DiagnosticFloatingHint
-hi default link LspDiagnosticsSignHint DiagnosticSignHint
-hi default link LspDiagnosticsDefaultError DiagnosticError
-hi default link LspDiagnosticsVirtualTextError DiagnosticVirtualTextError
-hi default link LspDiagnosticsFloatingError DiagnosticFloatingError
-hi default link LspDiagnosticsSignError DiagnosticSignError
-hi default link LspDiagnosticsDefaultWarning DiagnosticWarn
-hi default link LspDiagnosticsVirtualTextWarning DiagnosticVirtualTextWarn
-hi default link LspDiagnosticsFloatingWarning DiagnosticFloatingWarn
-hi default link LspDiagnosticsSignWarning DiagnosticSignWarn
-hi default link LspDiagnosticsDefaultInformation DiagnosticInfo
-hi default link LspDiagnosticsVirtualTextInformation DiagnosticVirtualTextInfo
-hi default link LspDiagnosticsFloatingInformation DiagnosticFloatingInfo
-hi default link LspDiagnosticsSignInformation DiagnosticSignInfo
-hi default link LspDiagnosticsUnderlineError DiagnosticUnderlineError
-hi default link LspDiagnosticsUnderlineWarning DiagnosticUnderlineWarn
-hi default link LspDiagnosticsUnderlineInformation DiagnosticUnderlineInfo
-hi default link LspDiagnosticsUnderlineHint DiagnosticUnderlineHint