aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/builtin.txt2
-rw-r--r--runtime/doc/news.txt2
-rw-r--r--runtime/doc/options.txt4
-rw-r--r--runtime/doc/repeat.txt33
-rw-r--r--runtime/lua/vim/_meta/options.lua4
-rw-r--r--runtime/lua/vim/_meta/vimfn.lua2
-rw-r--r--runtime/lua/vim/lsp/buf.lua14
-rw-r--r--runtime/lua/vim/lsp/util.lua21
-rw-r--r--runtime/syntax/help.vim22
-rw-r--r--runtime/syntax/help_it.vim17
-rw-r--r--runtime/syntax/jinja.vim3
-rw-r--r--src/nvim/eval.lua2
-rw-r--r--src/nvim/options.lua4
-rw-r--r--test/old/testdir/test_window_cmd.vim2
14 files changed, 86 insertions, 46 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 385ddf39a6..8567d6227c 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -11705,7 +11705,7 @@ wildmenumode() *wildmenumode()*
For example to make <c-j> work like <down> in wildmode, use: >vim
cnoremap <expr> <C-j> wildmenumode() ? "\<Down>\<Tab>" : "\<c-j>"
<
- (Note, this needs the 'wildcharm' option set appropriately).
+ (Note: this needs the 'wildcharm' option set appropriately).
Return: ~
(`any`)
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 4db9188f90..db2117e69f 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -182,6 +182,8 @@ LSP
• |vim.lsp.buf.format()| now supports passing a list of ranges
via the `range` parameter (this requires support for the
`textDocument/rangesFormatting` request).
+• |vim.lsp.buf.code_action()| actions show client name when there are multiple
+ clients.
LUA
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 3a6f93ae01..5dc1643ee3 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -6763,7 +6763,9 @@ A jump table for the options with a short description can be found at |Q_op|.
window. This happens only when the 'title' option is on.
When this option contains printf-style '%' items, they will be
- expanded according to the rules used for 'statusline'.
+ expanded according to the rules used for 'statusline'. If it contains
+ an invalid '%' format, the value is used as-is and no error or warning
+ will be given when the value is set.
This option cannot be set in a modeline when 'modelineexpr' is off.
Example: >vim
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 521d690d93..abeefb980e 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -967,21 +967,24 @@ For example, to profile the one_script.vim script file: >
:prof[ile] start {fname} *:prof* *:profile* *E750*
- Start profiling, write the output in {fname} upon exit.
+ Start profiling, write the output in {fname} upon exit or when
+ a `:profile stop` or `:profile dump` command is invoked.
"~/" and environment variables in {fname} will be expanded.
If {fname} already exists it will be silently overwritten.
The variable |v:profiling| is set to one.
:prof[ile] stop
- Write the logfile and stop profiling.
+ Write the collected profiling information to the logfile and
+ stop profiling. You can use the `:profile start` command to
+ clear the profiling statistics and start profiling again.
:prof[ile] pause
- Don't profile until the following ":profile continue". Can be
- used when doing something that should not be counted (e.g., an
- external command). Does not nest.
+ Stop profiling until the next `:profile continue` command.
+ Can be used when doing something that should not be counted
+ (e.g., an external command). Does not nest.
:prof[ile] continue
- Continue profiling after ":profile pause".
+ Continue profiling after `:profile pause`.
:prof[ile] func {pattern}
Profile function that matches the pattern {pattern}.
@@ -999,16 +1002,24 @@ For example, to profile the one_script.vim script file: >
won't work.
:prof[ile] dump
- Don't wait until exiting Vim and write the current state of
- profiling to the log immediately.
+ Write the current state of profiling to the logfile
+ immediately. After running this command, Vim continues to
+ collect the profiling statistics.
:profd[el] ... *:profd* *:profdel*
Stop profiling for the arguments specified. See |:breakdel|
- for the arguments.
-
+ for the arguments. Examples: >
+ profdel func MyFunc
+ profdel file MyScript.vim
+ profdel here
You must always start with a ":profile start fname" command. The resulting
-file is written when Vim exits. Here is an example of the output, with line
+file is written when Vim exits. For example, to profile one specific
+function: >
+ profile start /tmp/vimprofile
+ profile func MyFunc
+
+Here is an example of the output, with line
numbers prepended for the explanation:
1 FUNCTION Test2() ~
diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua
index 36c0f583c7..c33753047f 100644
--- a/runtime/lua/vim/_meta/options.lua
+++ b/runtime/lua/vim/_meta/options.lua
@@ -7310,7 +7310,9 @@ vim.go.titleold = vim.o.titleold
--- window. This happens only when the 'title' option is on.
---
--- When this option contains printf-style '%' items, they will be
---- expanded according to the rules used for 'statusline'.
+--- expanded according to the rules used for 'statusline'. If it contains
+--- an invalid '%' format, the value is used as-is and no error or warning
+--- will be given when the value is set.
--- This option cannot be set in a modeline when 'modelineexpr' is off.
---
--- Example:
diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index 4e5d3f5701..f40a94a442 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -10629,7 +10629,7 @@ function vim.fn.wait(timeout, condition, interval) end
--- For example to make <c-j> work like <down> in wildmode, use: >vim
--- cnoremap <expr> <C-j> wildmenumode() ? "\<Down>\<Tab>" : "\<c-j>"
--- <
---- (Note, this needs the 'wildcharm' option set appropriately).
+--- (Note: this needs the 'wildcharm' option set appropriately).
---
--- @return any
function vim.fn.wildmenumode() end
diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua
index e3f4beeeb1..ccef314d86 100644
--- a/runtime/lua/vim/lsp/buf.lua
+++ b/runtime/lua/vim/lsp/buf.lua
@@ -829,11 +829,19 @@ local function on_code_action_results(results, opts)
return
end
- ---@param item {action: lsp.Command|lsp.CodeAction}
+ ---@param item {action: lsp.Command|lsp.CodeAction, ctx: lsp.HandlerContext}
local function format_item(item)
- local title = item.action.title:gsub('\r\n', '\\r\\n')
- return title:gsub('\n', '\\n')
+ local clients = vim.lsp.get_clients({ bufnr = item.ctx.bufnr })
+ local title = item.action.title:gsub('\r\n', '\\r\\n'):gsub('\n', '\\n')
+
+ if #clients == 1 then
+ return title
+ end
+
+ local source = vim.lsp.get_client_by_id(item.ctx.client_id).name
+ return ('%s [%s]'):format(title, source)
end
+
local select_opts = {
prompt = 'Code actions:',
kind = 'codeaction',
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 76a18a409c..e3eef8901b 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -159,25 +159,24 @@ end
---@param encoding string utf-8|utf-16|utf-32| defaults to utf-16
---@return integer byte (utf-8) index of `encoding` index `index` in `line`
function M._str_byteindex_enc(line, index, encoding)
- local len = #line
- if index > len then
- -- LSP spec: if character > line length, default to the line length.
- -- https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position
- return len
- end
+ -- LSP spec: if character > line length, default to the line length.
+ -- https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position
+ local len8 = #line
if not encoding then
encoding = 'utf-16'
end
if encoding == 'utf-8' then
- if index then
+ if index and index <= len8 then
return index
else
- return len
+ return len8
end
- elseif encoding == 'utf-16' then
- return vim.str_byteindex(line, index, true)
+ end
+ local len32, len16 = vim.str_utfindex(line)
+ if encoding == 'utf-16' then
+ return index <= len16 and vim.str_byteindex(line, index, true) or len8
elseif encoding == 'utf-32' then
- return vim.str_byteindex(line, index)
+ return index <= len32 and vim.str_byteindex(line, index) or len8
else
error('Invalid encoding: ' .. vim.inspect(encoding))
end
diff --git a/runtime/syntax/help.vim b/runtime/syntax/help.vim
index bccbacaeec..c8ad8bfe4a 100644
--- a/runtime/syntax/help.vim
+++ b/runtime/syntax/help.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Vim help file
" Maintainer: The Vim Project <https://github.com/vim/vim>
-" Last Change: 2024 Oct 08
+" Last Change: 2024 Oct 16
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Quit when a (custom) syntax file was already loaded
@@ -43,7 +43,8 @@ syn match helpOption "'[a-z]\{2,\}'"
syn match helpOption "'t_..'"
syn match helpNormal "'ab'"
syn match helpCommand "`[^` \t]\+`"hs=s+1,he=e-1 contains=helpBacktick
-syn match helpCommand "\(^\|[^a-z"[]\)\zs`[^`]\+`\ze\([^a-z\t."']\|$\)"hs=s+1,he=e-1 contains=helpBacktick
+" doesn't allow a . directly after an ending backtick. See :helpgrep `[^`,]\+ [^`,]\+`\.
+syn match helpCommand "\(^\|[^a-z"[]\)\zs`[^`]\+`\ze\([^a-z\t."']\|[.?!]\?$\)"hs=s+1,he=e-1 contains=helpBacktick
syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore
syn match helpGraphic ".* \ze`$" nextgroup=helpIgnore
if has("conceal")
@@ -52,6 +53,7 @@ else
syn match helpIgnore "." contained
endif
syn keyword helpNote note Note NOTE note: Note: NOTE: Notes Notes:
+syn match helpNote "\c(note\(:\|\>\)"ms=s+1
syn keyword helpWarning WARNING WARNING: Warning:
syn keyword helpDeprecated DEPRECATED DEPRECATED: Deprecated:
syn match helpSpecial "\<N\>"
@@ -64,6 +66,10 @@ syn match helpSpecial "\[N]"
syn match helpSpecial "N N"he=s+1
syn match helpSpecial "Nth"me=e-2
syn match helpSpecial "N-1"me=e-2
+" highlighting N for :resize in windows.txt
+syn match helpSpecial "] -N\>"ms=s+3
+syn match helpSpecial "+N\>"ms=s+1
+syn match helpSpecial "\[+-]N\>"ms=s+4
" highlighting N of cinoptions-values in indent.txt
syn match helpSpecial "^\t-\?\zsNs\?\s"me=s+1
" highlighting N of cinoptions-values in indent.txt
@@ -139,7 +145,7 @@ syn match helpUnderlined "\t[* ]Underlined\t\+[a-z].*"
syn match helpError "\t[* ]Error\t\+[a-z].*"
syn match helpTodo "\t[* ]Todo\t\+[a-z].*"
-syn match helpURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-zA-Z0-9/]`
+syn match helpURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^'" \t<>{}]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^'" \t<>{}]+)[a-zA-Z0-9/]`
syn match helpDiffAdded "\t[* ]Added\t\+[a-z].*"
syn match helpDiffChanged "\t[* ]Changed\t\+[a-z].*"
@@ -151,16 +157,6 @@ if s:i > 0
exe "runtime syntax/help_" . strpart(expand("%"), s:i + 1, 2) . ".vim"
endif
-" Italian
-if v:lang =~ '\<IT\>' || v:lang =~ '_IT\>' || v:lang =~? "italian"
- syn keyword helpNote nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE:
- syn match helpSpecial "Nma"me=e-2
- syn match helpSpecial "Nme"me=e-2
- syn match helpSpecial "Nmi"me=e-2
- syn match helpSpecial "Nmo"me=e-2
- syn match helpSpecial "\[interv.]"
-endif
-
syn sync minlines=40
diff --git a/runtime/syntax/help_it.vim b/runtime/syntax/help_it.vim
new file mode 100644
index 0000000000..e76851d446
--- /dev/null
+++ b/runtime/syntax/help_it.vim
@@ -0,0 +1,17 @@
+" Vim syntax file
+" Language: Italian Vim program help files *.itx
+" Maintainer: The Vim Project <https://github.com/vim/vim>
+" Last Change: 2024 Oct 16
+"
+" This script is sourced from syntax/help.vim.
+
+syn keyword helpNote nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE:
+syn match helpNote "\c(nota\(:\|\>\)"ms=s+1
+syn match helpSpecial "Nma"me=e-2
+syn match helpSpecial "Nme"me=e-2
+syn match helpSpecial "Nmi"me=e-2
+syn match helpSpecial "Nmo"me=e-2
+syn match helpSpecial "\[interv.]"
+syn region helpNotVi start="{non" start="{solo" start="{disponibile" end="}" contains=helpLeadBlank,helpHyperTextJump
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/jinja.vim b/runtime/syntax/jinja.vim
index 6000855ff7..fa32c05f17 100644
--- a/runtime/syntax/jinja.vim
+++ b/runtime/syntax/jinja.vim
@@ -2,8 +2,9 @@
" Language: Jinja
" Maintainer: Gregory Anders
" Upstream: https://gitlab.com/HiPhish/jinja.vim
+" Last Change: 2024 Oct 16
-if exists('b:current_syntax')
+if exists('b:current_syntax') && b:current_syntax =~? 'jinja'
finish
endif
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
index 34072cbb88..d60e9bd290 100644
--- a/src/nvim/eval.lua
+++ b/src/nvim/eval.lua
@@ -12772,7 +12772,7 @@ M.funcs = {
For example to make <c-j> work like <down> in wildmode, use: >vim
cnoremap <expr> <C-j> wildmenumode() ? "\<Down>\<Tab>" : "\<c-j>"
<
- (Note, this needs the 'wildcharm' option set appropriately).
+ (Note: this needs the 'wildcharm' option set appropriately).
]=],
name = 'wildmenumode',
params = {},
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index 3c3eaaf5a1..fba5eab0bc 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -9130,7 +9130,9 @@ return {
window. This happens only when the 'title' option is on.
When this option contains printf-style '%' items, they will be
- expanded according to the rules used for 'statusline'.
+ expanded according to the rules used for 'statusline'. If it contains
+ an invalid '%' format, the value is used as-is and no error or warning
+ will be given when the value is set.
This option cannot be set in a modeline when 'modelineexpr' is off.
Example: >vim
diff --git a/test/old/testdir/test_window_cmd.vim b/test/old/testdir/test_window_cmd.vim
index 50da2beb40..8048fa6ff8 100644
--- a/test/old/testdir/test_window_cmd.vim
+++ b/test/old/testdir/test_window_cmd.vim
@@ -539,7 +539,7 @@ func Test_equalalways_on_close()
1wincmd w
split
4wincmd w
- resize + 5
+ resize +5
" left column has three windows, equalized heights.
" right column has two windows, top one a bit higher
let height_1 = winheight(1)