diff --git a/BUILD.md b/BUILD.md index b0a59460ce..09fc9536e5 100644 --- a/BUILD.md +++ b/BUILD.md @@ -342,7 +342,7 @@ custom terminfo at runtime, use make CMAKE_EXTRA_FLAGS="-DENABLE_UNIBILIUM=0" DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_UNIBILIUM=0" ``` -To confirm at runtime that unibilium was not included, check `has('terminfo') == 1`. +To confirm at runtime that unibilium was not included, check `has('terminfo') == 0`. ### Build with specific "bundled" dependencies diff --git a/runtime/doc/dev.txt b/runtime/doc/dev.txt index 2b91ed56fb..8cd0857123 100644 --- a/runtime/doc/dev.txt +++ b/runtime/doc/dev.txt @@ -420,7 +420,7 @@ API PATTERNS *dev-api-patterns* - |OptionSet| event - Scopes: global/buf/win/tab (can start as global, then "graduate" later) - UI: `:verbose set`, `:options`, etc. - - Alternatively if the editor |options| system absolutey doesn't fit: Expose + - Alternatively if the editor |options| system absolutely doesn't fit: Expose a `config(opts)` interface (example: |vim.diagnostic.config()|). If `opts` is omitted (or `nil`) it returns the current configuration. - "Enable" ("toggle") interface and behavior: diff --git a/runtime/doc/dev_arch.txt b/runtime/doc/dev_arch.txt index 8366da70f5..4768db01f4 100644 --- a/runtime/doc/dev_arch.txt +++ b/runtime/doc/dev_arch.txt @@ -209,7 +209,7 @@ Filesystem *dev-filesystem* https://github.com/neovim/neovim/issues/36112 Path handling, especially separator chars ("/" vs "\"), is designed as follows: "/" separators are used -every except at the "edges", i.e. the separator chars are coverted +everywhere except at the "edges", i.e. the separator chars are converted just-in-time, and only when absolutely needed. This is similar to how UTF-8 encoding is used internally for all text, but buffers can read/write various encodings. diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index d58f59a5ab..a33365fabb 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -55,7 +55,7 @@ continues in the background), or |:connect| to another instance. Use cases: - keep the session running on remote machines after (unexpected) SSH disconnect - open files in an existing session from your OS file explorer -- run Nvim as a background process (daemon/service), atttach/detach as needed +- run Nvim as a background process (daemon/service), attach/detach as needed ------------------------------------------------------------------------------ Stop or detach the current UI diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 87f56ef663..77e748d005 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1949,6 +1949,11 @@ vim.str_byteindex({s}, {encoding}, {index}, {strict_indexing}) *vim.str_byteind {strict_indexing} is false then an out of range index will return byte length instead of throwing an error. + Use `"utf-32"` to convert Unicode code-point indices to byte indices. + `"utf-8"` is Nvim's native string encoding, so this function is idempotent + for that encoding: {index} is already a byte index and is returned + unchanged. + Invalid UTF-8 and NUL is treated like in |vim.str_utfindex()|. An {index} in the middle of a UTF-16 sequence is rounded upwards to the end of that sequence. diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index e1d7044f96..e8ca8c073b 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -123,6 +123,9 @@ EDITOR • `stdpath("log")` moved to `stdpath("state")/logs`. • An operator on a target that creates a Visual selection ("cgn") does not change |'<| |'>|. |gv| +• After a motion forced blockwise (|o_CTRL-V|), |']| is on the last column + of the block: "g@l" gives 'operatorfunc' the block that "yl" + yanks. • |cmdwin| (|q:|, |q/|, |q?|, |c_CTRL-F|): • Only supports one "cmdline level", not "infinite recursion". • Expr-register (|i_CTRL-R_=|, |c_CTRL-R_=|) no longer supports opening diff --git a/runtime/doc/vimfn.txt b/runtime/doc/vimfn.txt index 49254584a1..8f6e2dd22e 100644 --- a/runtime/doc/vimfn.txt +++ b/runtime/doc/vimfn.txt @@ -6923,7 +6923,7 @@ matchbufline({buf}, {pat}, {lnum}, {end}, [, {dict}]) *matchbufline()* • {dict} (`table?`) Return: ~ - (`string[]`) + (`table`) matchdelete({id} [, {win}]) *matchdelete()* *E802* *E803* Deletes a match with ID {id} previously defined by |matchadd()| diff --git a/runtime/lua/vim/_core/editor.lua b/runtime/lua/vim/_core/editor.lua index a3490c8cb6..7ebb5f22d5 100644 --- a/runtime/lua/vim/_core/editor.lua +++ b/runtime/lua/vim/_core/editor.lua @@ -801,6 +801,11 @@ end --- then an out of range index will return byte length --- instead of throwing an error. --- +--- Use `"utf-32"` to convert Unicode code-point indices to byte indices. +--- `"utf-8"` is Nvim's native string encoding, so this function is +--- idempotent for that encoding: {index} is already a byte index and is +--- returned unchanged. +--- --- Invalid UTF-8 and NUL is treated like in |vim.str_utfindex()|. --- An {index} in the middle of a UTF-16 sequence is rounded upwards to --- the end of that sequence. diff --git a/runtime/lua/vim/_core/shared.lua b/runtime/lua/vim/_core/shared.lua index f3c7a37d60..731921efd5 100644 --- a/runtime/lua/vim/_core/shared.lua +++ b/runtime/lua/vim/_core/shared.lua @@ -1570,6 +1570,7 @@ end --- @param context vim.context.mods --- @param f fun(): R... --- @return R... +--- @overload fun(context: vim.context.mods, f: fun()) function vim._with(context, f) vim.validate('context', context, 'table') vim.validate('f', f, 'function') diff --git a/runtime/lua/vim/_meta/vimfn.gen.lua b/runtime/lua/vim/_meta/vimfn.gen.lua index 589140169e..3e5e3aac7b 100644 --- a/runtime/lua/vim/_meta/vimfn.gen.lua +++ b/runtime/lua/vim/_meta/vimfn.gen.lua @@ -6147,7 +6147,7 @@ function vim.fn.matcharg(nr) end --- @param lnum string|integer --- @param end_ string|integer --- @param dict? table ---- @return string[] +--- @return table function vim.fn.matchbufline(buf, pat, lnum, end_, dict) end --- Deletes a match with ID {id} previously defined by |matchadd()| diff --git a/runtime/lua/vim/_meta/vimfn_types.lua b/runtime/lua/vim/_meta/vimfn_types.lua index c80493d3f2..b1da31af9b 100644 --- a/runtime/lua/vim/_meta/vimfn_types.lua +++ b/runtime/lua/vim/_meta/vimfn_types.lua @@ -67,6 +67,7 @@ error('Cannot require a meta file') --- @field wincol integer --- @field line integer --- @field column integer +--- @field coladd integer --- @class vim.fn.getqflist.what --- @field all? integer diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index de74abee66..94be551ffe 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -7508,7 +7508,7 @@ M.funcs = { { 'dict', 'table' }, }, signature = 'matchbufline({buf}, {pat}, {lnum}, {end}, [, {dict}])', - returns = 'string[]', + returns = 'table', }, matchdelete = { args = { 1, 2 },