diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/api.txt | 2 | ||||
-rw-r--r-- | runtime/doc/autocmd.txt | 8 | ||||
-rw-r--r-- | runtime/doc/builtin.txt | 5 | ||||
-rw-r--r-- | runtime/doc/diagnostic.txt | 12 | ||||
-rw-r--r-- | runtime/doc/lsp.txt | 6 | ||||
-rw-r--r-- | runtime/doc/lua-guide.txt | 2 | ||||
-rw-r--r-- | runtime/doc/news.txt | 3 | ||||
-rw-r--r-- | runtime/lua/vim/diagnostic.lua | 36 | ||||
-rw-r--r-- | runtime/lua/vim/filetype.lua | 10 | ||||
-rw-r--r-- | runtime/lua/vim/lsp.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/rpc.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/semantic_tokens.lua | 2 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 2 |
13 files changed, 55 insertions, 37 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index d74657dc8e..0e1cc3c28c 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1133,7 +1133,7 @@ nvim_list_uis() *nvim_list_uis()* • "width" Requested width of the UI • "rgb" true if the UI uses RGB colors (false implies |cterm-colors|) • "ext_..." Requested UI extensions, see |ui-option| - • "chan" Channel id of remote UI or 0 for TUI + • "chan" |channel-id| of remote UI nvim_list_wins() *nvim_list_wins()* Gets the current list of window handles. diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index a39407aeca..8cc4754880 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -681,16 +681,12 @@ FuncUndefined When a user function is used but it isn't UIEnter After a UI connects via |nvim_ui_attach()|, or after builtin TUI is started, after |VimEnter|. Sets these |v:event| keys: - chan: 0 for builtin TUI - 1 for |--embed| - |channel-id| of the UI otherwise + chan: |channel-id| of the UI *UILeave* UILeave After a UI disconnects from Nvim, or after builtin TUI is stopped, after |VimLeave|. Sets these |v:event| keys: - chan: 0 for builtin TUI - 1 for |--embed| - |channel-id| of the UI otherwise + chan: |channel-id| of the UI *InsertChange* InsertChange When typing <Insert> while in Insert or Replace mode. The |v:insertmode| variable diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index cc1d1b568d..3dc21c0d73 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -2958,7 +2958,8 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* arglist file names in argument list augroup autocmd groups buffer buffer names - behave :behave suboptions + behave |:behave| suboptions + breakpoint |:breakadd| and |:breakdel| suboptions cmdline |cmdline-completion| result color color schemes command Ex command @@ -2974,7 +2975,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* function function name help help subjects highlight highlight groups - history :history suboptions + history |:history| suboptions locale locale names (as output of locale -a) mapclear buffer argument mapping mapping name diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index 66ac2170e3..7066a3739a 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -565,6 +565,18 @@ hide({namespace}, {bufnr}) *vim.diagnostic.hide()* • {bufnr} (number|nil) Buffer number, or 0 for current buffer. When omitted, hide diagnostics in all buffers. +is_disabled({bufnr}, {namespace}) *vim.diagnostic.is_disabled()* + Check whether diagnostics are disabled in a given buffer. + + Parameters: ~ + • {bufnr} (number|nil) Buffer number, or 0 for current buffer. + • {namespace} (number|nil) Diagnostic namespace. When omitted, checks if all diagnostics are + disabled in {bufnr}. Otherwise, only checks if + diagnostics from {namespace} are disabled. + + Return: ~ + (boolean) + *vim.diagnostic.match()* match({str}, {pat}, {groups}, {severity_map}, {defaults}) Parse a diagnostic from a string. diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index aff0f9a793..46cfa60529 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -566,7 +566,7 @@ buf_notify({bufnr}, {method}, {params}) *vim.lsp.buf_notify()* Parameters: ~ • {bufnr} (number|nil) The number of the buffer • {method} (string) Name of the request method - • {params} (string) Arguments to send to the server + • {params} (any) Arguments to send to the server Return: ~ true if any client returns true; false otherwise @@ -1508,8 +1508,8 @@ convert_input_to_markdown_lines({input}, {contents}) Parameters: ~ • {input} (`MarkedString` | `MarkedString[]` | `MarkupContent`) - • {contents} (table, optional, default `{}`) List of strings to extend - with converted lines + • {contents} (table|nil) List of strings to extend with converted + lines. Defaults to {}. Return: ~ {contents}, extended with lines of converted markdown. diff --git a/runtime/doc/lua-guide.txt b/runtime/doc/lua-guide.txt index 71dc48b715..b971a7d2ad 100644 --- a/runtime/doc/lua-guide.txt +++ b/runtime/doc/lua-guide.txt @@ -406,9 +406,9 @@ mandatory arguments: prefix for which the mapping will take effect. The prefixes are the ones listed in |:map-modes|, or "!" for |:map!|, or empty string for |:map|. • {lhs} is a string with the key sequences that should trigger the mapping. - An empty string is equivalent to |<Nop>|, which disables a key. • {rhs} is either a string with a Vim command or a Lua function that should be executed when the {lhs} is entered. + An empty string is equivalent to |<Nop>|, which disables a key. Examples: >lua diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 7dceaa3318..ce07c3035c 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -135,6 +135,9 @@ The following new APIs or features were added. See https://github.com/neovim/neovim/pull/14537. +• |vim.diagnostic.is_disabled()| checks if diagnostics are disabled in a given + buffer or namespace. + • |--remote-ui| option was added to connect to a remote instance and display in it in a |TUI| in the local terminal. This can be used run a headless nvim instance in the background and display its UI on demand, which previously diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index f41f4a9c68..6fd000a029 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -252,19 +252,6 @@ local function get_bufnr(bufnr) end ---@private -local function is_disabled(namespace, bufnr) - local ns = M.get_namespace(namespace) - if ns.disabled then - return true - end - - if type(diagnostic_disabled[bufnr]) == 'table' then - return diagnostic_disabled[bufnr][namespace] - end - return diagnostic_disabled[bufnr] -end - ----@private local function diagnostic_lines(diagnostics) if not diagnostics then return {} @@ -1119,6 +1106,27 @@ function M.hide(namespace, bufnr) end end +--- Check whether diagnostics are disabled in a given buffer. +--- +---@param bufnr number|nil Buffer number, or 0 for current buffer. +---@param namespace number|nil Diagnostic namespace. When omitted, checks if +--- all diagnostics are disabled in {bufnr}. +--- Otherwise, only checks if diagnostics from +--- {namespace} are disabled. +---@return boolean +function M.is_disabled(bufnr, namespace) + bufnr = get_bufnr(bufnr) + if namespace and M.get_namespace(namespace).disabled then + return true + end + + if type(diagnostic_disabled[bufnr]) == 'table' then + return diagnostic_disabled[bufnr][namespace] + end + + return diagnostic_disabled[bufnr] ~= nil +end + --- Display diagnostics for the given namespace and buffer. --- ---@param namespace number|nil Diagnostic namespace. When omitted, show @@ -1162,7 +1170,7 @@ function M.show(namespace, bufnr, diagnostics, opts) return end - if is_disabled(namespace, bufnr) then + if M.is_disabled(bufnr, namespace) then return end diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index c3ab39a1a3..b73519f1be 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -327,11 +327,7 @@ local extension = { end, eex = 'eelixir', leex = 'eelixir', - am = function(path, bufnr) - if not path:lower():find('makefile%.am$') then - return 'elf' - end - end, + am = 'elf', exs = 'elixir', elm = 'elm', elv = 'elvish', @@ -949,12 +945,14 @@ local extension = { ice = 'slice', score = 'slrnsc', sol = 'solidity', + smali = 'smali', tpl = 'smarty', ihlp = 'smcl', smcl = 'smcl', hlp = 'smcl', smith = 'smith', smt = 'smith', + smithy = 'smithy', sml = 'sml', spt = 'snobol4', sno = 'snobol4', @@ -1323,6 +1321,7 @@ local filename = { ['GNUmakefile.am'] = 'automake', ['named.root'] = 'bindzone', WORKSPACE = 'bzl', + ['WORKSPACE.bzlmod'] = 'bzl', BUILD = 'bzl', ['cabal.project'] = 'cabalproject', ['cabal.config'] = 'cabalconfig', @@ -1427,6 +1426,7 @@ local filename = { gnashpluginrc = 'gnash', gnashrc = 'gnash', ['.gnuplot'] = 'gnuplot', + ['go.sum'] = 'gosum', ['go.work'] = 'gowork', ['.gprc'] = 'gp', ['/.gnupg/gpg.conf'] = 'gpg', diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 13f8c81dfb..cfd6c938f7 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -2048,7 +2048,7 @@ end --- Send a notification to a server ---@param bufnr (number|nil) The number of the buffer ---@param method (string) Name of the request method ----@param params (string) Arguments to send to the server +---@param params (any) Arguments to send to the server --- ---@returns true if any client returns true; false otherwise function lsp.buf_notify(bufnr, method, params) diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua index b93b227150..f1492601ff 100644 --- a/runtime/lua/vim/lsp/rpc.lua +++ b/runtime/lua/vim/lsp/rpc.lua @@ -293,7 +293,7 @@ end ---@private --- Sends a notification to the LSP server. ---@param method (string) The invoked LSP method ----@param params (table|nil): Parameters for the invoked LSP method +---@param params (any): Parameters for the invoked LSP method ---@returns (bool) `true` if notification could be sent, `false` if not function Client:notify(method, params) return self:encode_and_send({ diff --git a/runtime/lua/vim/lsp/semantic_tokens.lua b/runtime/lua/vim/lsp/semantic_tokens.lua index b035ac43f4..b1bc48dac6 100644 --- a/runtime/lua/vim/lsp/semantic_tokens.lua +++ b/runtime/lua/vim/lsp/semantic_tokens.lua @@ -408,7 +408,6 @@ function STHighlighter:on_win(topline, botline) hl_group = '@' .. token.type, end_col = token.end_col, priority = vim.highlight.priorities.semantic_tokens, - end_right_gravity = true, strict = false, }) @@ -419,7 +418,6 @@ function STHighlighter:on_win(topline, botline) hl_group = '@' .. modifier, end_col = token.end_col, priority = vim.highlight.priorities.semantic_tokens + 1, - end_right_gravity = true, strict = false, }) end diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 26f0e180f5..38051e6410 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -856,7 +856,7 @@ end --- `textDocument/signatureHelp`, and potentially others. --- ---@param input (`MarkedString` | `MarkedString[]` | `MarkupContent`) ----@param contents (table, optional, default `{}`) List of strings to extend with converted lines +---@param contents (table|nil) List of strings to extend with converted lines. Defaults to {}. ---@returns {contents}, extended with lines of converted markdown. ---@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_hover function M.convert_input_to_markdown_lines(input, contents) |