From 4367441213de95b178c16589e80fdbcec10c010b Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sun, 18 May 2025 16:09:30 +0200 Subject: [PATCH] docs: misc Co-authored-by: Jan Weinkauff Co-authored-by: MeanderingProgrammer Co-authored-by: Yochem van Rosmalen Co-authored-by: phanium <91544758+phanen@users.noreply.github.com> --- MAINTAIN.md | 4 ++-- runtime/doc/diagnostic.txt | 2 +- runtime/doc/luvref.txt | 4 ++-- runtime/doc/treesitter.txt | 6 +++--- runtime/doc/vim_diff.txt | 1 + runtime/doc/vimfn.txt | 9 +++++++++ runtime/lua/vim/_meta/vimfn.lua | 9 +++++++++ runtime/lua/vim/treesitter.lua | 4 ++-- src/nvim/eval.lua | 17 +++++++++-------- 9 files changed, 38 insertions(+), 18 deletions(-) diff --git a/MAINTAIN.md b/MAINTAIN.md index 22a8006f40..f82b8a12e0 100644 --- a/MAINTAIN.md +++ b/MAINTAIN.md @@ -128,8 +128,8 @@ Some can be auto-bumped by `scripts/bump_deps.lua`. * [Lua](https://www.lua.org/download.html) * [Luv](https://github.com/luvit/luv) * When bumping, also sync - - [our bundled meta file](https://github.com/neovim/neovim/blob/master/runtime/lua/uv/_meta.lua) with [the upstream meta file](https://github.com/luvit/luv/blob/master/meta.lua); - - [our bundled documentation](https://github.com/neovim/neovim/blob/master/runtime/doc/luvref.txt) with [the upstream documentation](https://github.com/luvit/luv/blob/master/docs.md). + - [our bundled meta file](https://github.com/neovim/neovim/blob/master/runtime/lua/uv/_meta.lua) with [the upstream meta file](https://github.com/luvit/luv/blob/master/docs/meta.lua); + - [our bundled documentation](https://github.com/neovim/neovim/blob/master/runtime/doc/luvref.txt) with [the upstream documentation](https://github.com/luvit/luv/blob/master/docs/docs.md). * [gettext](https://ftp.gnu.org/pub/gnu/gettext/) * [libiconv](https://ftp.gnu.org/pub/gnu/libiconv) * [libuv](https://github.com/libuv/libuv) diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index 796dbc1330..28309b1454 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -211,7 +211,7 @@ following uses the `virtual_lines` handler when jumping to a diagnostic: >lua end vim.diagnostic.config({ jump = { on_jump = on_jump } }) - +< *diagnostic-loclist-example* Whenever the |location-list| is opened, the following `show` handler will show the most recent diagnostics: >lua diff --git a/runtime/doc/luvref.txt b/runtime/doc/luvref.txt index 209939c75e..73b1fb633b 100644 --- a/runtime/doc/luvref.txt +++ b/runtime/doc/luvref.txt @@ -2202,7 +2202,7 @@ uv.pipe_bind2({pipe}, {name}, {flags}) *uv.pipe_bind2()* Returns: `0` or `fail` - *Note*: + Note: 1. Paths on Unix get truncated to sizeof(sockaddr_un.sun_path) bytes, typically between 92 and 108 bytes. 2. New in version 1.46.0. @@ -2235,7 +2235,7 @@ uv.pipe_connect2(pipe, name, [flags], [callback]) *uv.pipe_connect2()* Returns: `uv_connect_t userdata` or `fail` - *Note*: + Note: 1. Paths on Unix get truncated to sizeof(sockaddr_un.sun_path) bytes, typically between 92 and 108 bytes. 2. New in version 1.46.0. diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 17bc7ec371..ee71149ad6 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -69,7 +69,7 @@ allows you to associate names with a specific node in a pattern. A `predicate` adds arbitrary metadata and conditional data to a match. Queries are written in a lisp-like language documented in -https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax +https://tree-sitter.github.io/tree-sitter/using-parsers/queries/1-syntax.html Note: The predicates listed there differ from those Nvim supports. See |treesitter-predicates| for a complete list of predicates supported by Nvim. @@ -1134,7 +1134,7 @@ start({bufnr}, {lang}) *vim.treesitter.start()* Can be used in an ftplugin or FileType autocommand. Note: By default, disables regex syntax highlighting, which may be - required for some plugins. In this case, add `vim.bo.syntax = 'on'` after + required for some plugins. In this case, add `vim.bo.syntax = 'ON'` after the call to `start`. Note: By default, the highlighter parses code asynchronously, using a @@ -1144,7 +1144,7 @@ start({bufnr}, {lang}) *vim.treesitter.start()* vim.api.nvim_create_autocmd( 'FileType', { pattern = 'tex', callback = function(args) vim.treesitter.start(args.buf, 'latex') - vim.bo[args.buf].syntax = 'on' -- only if additional legacy syntax is needed + vim.bo[args.buf].syntax = 'ON' -- only if additional legacy syntax is needed end }) < diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index f3d1c825f9..727a9d82d2 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -490,6 +490,7 @@ These Nvim features were later integrated into Vim. - |:sign-define| "numhl" argument - |:source| works with anonymous (no file) scripts - 'statusline' supports unlimited alignment sections +- |vim-tutor-mode| ============================================================================== Other changes *nvim-changed* diff --git a/runtime/doc/vimfn.txt b/runtime/doc/vimfn.txt index dd049e9475..3ab5db31e4 100644 --- a/runtime/doc/vimfn.txt +++ b/runtime/doc/vimfn.txt @@ -3115,6 +3115,7 @@ getbufvar({buf}, {varname} [, {def}]) *getbufvar()* Examples: >vim let bufmodified = getbufvar(1, "&mod") echo "todo myvar = " .. getbufvar("todo", "myvar") +< Parameters: ~ • {buf} (`integer|string`) @@ -4520,6 +4521,7 @@ getwinvar({winnr}, {varname} [, {def}]) *getwinvar()* Examples: >vim let list_is_on = getwinvar(2, '&list') echo "myvar = " .. getwinvar(1, 'myvar') +< Parameters: ~ • {winnr} (`integer`) @@ -5219,6 +5221,7 @@ inputlist({textlist}) *inputlist()* Example: >vim let color = inputlist(['Select color:', '1. red', \ '2. green', '3. blue']) +< Parameters: ~ • {textlist} (`string[]`) @@ -5720,6 +5723,7 @@ libcall({libname}, {funcname}, {argument}) *libcall()* *E364* *E object code must be compiled as position-independent ('PIC'). Examples: >vim echo libcall("libc.so", "getenv", "HOME") +< Parameters: ~ • {libname} (`string`) @@ -9305,6 +9309,7 @@ setreg({regname}, {value} [, {options}]) *setreg()* You can also change the type of a register by appending nothing: >vim call setreg('a', '', 'al') +< Parameters: ~ • {regname} (`string`) @@ -9402,6 +9407,7 @@ setwinvar({nr}, {varname}, {val}) *setwinvar()* Examples: >vim call setwinvar(1, "&list", 0) call setwinvar(2, "myvar", "foobar") +< Parameters: ~ • {nr} (`integer`) @@ -9872,6 +9878,7 @@ sign_unplace({group} [, {dict}]) *sign_unplace()* " Remove all the placed signs from all the buffers call sign_unplace('*') +< Parameters: ~ • {group} (`string`) @@ -10528,6 +10535,7 @@ strftime({format} [, {time}]) *strftime()* echo strftime("%H:%M") " 11:55 echo strftime("%c", getftime("file.c")) " Show mod time of file.c. +< Parameters: ~ • {format} (`string`) @@ -10870,6 +10878,7 @@ swapfilelist() *swapfilelist()* let &directory = '.' let swapfiles = swapfilelist() let &directory = save_dir +< Return: ~ (`string[]`) diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 668d410fb3..ac024f58f1 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -2785,6 +2785,7 @@ function vim.fn.getbufoneline(buf, lnum) end --- Examples: >vim --- let bufmodified = getbufvar(1, "&mod") --- echo "todo myvar = " .. getbufvar("todo", "myvar") +--- < --- --- @param buf integer|string --- @param varname string @@ -4079,6 +4080,7 @@ function vim.fn.getwinposy() end --- Examples: >vim --- let list_is_on = getwinvar(2, '&list') --- echo "myvar = " .. getwinvar(1, 'myvar') +--- < --- --- @param winnr integer --- @param varname string @@ -4735,6 +4737,7 @@ function vim.fn.inputdialog(...) end --- Example: >vim --- let color = inputlist(['Select color:', '1. red', --- \ '2. green', '3. blue']) +--- < --- --- @param textlist string[] --- @return any @@ -5190,6 +5193,7 @@ function vim.fn.len(expr) end --- object code must be compiled as position-independent ('PIC'). --- Examples: >vim --- echo libcall("libc.so", "getenv", "HOME") +--- < --- --- @param libname string --- @param funcname string @@ -8489,6 +8493,7 @@ function vim.fn.setqflist(list, action, what) end --- You can also change the type of a register by appending --- nothing: >vim --- call setreg('a', '', 'al') +--- < --- --- @param regname string --- @param value any @@ -8574,6 +8579,7 @@ function vim.fn.settagstack(nr, dict, action) end --- Examples: >vim --- call setwinvar(1, "&list", 0) --- call setwinvar(2, "myvar", "foobar") +--- < --- --- @param nr integer --- @param varname string @@ -9018,6 +9024,7 @@ function vim.fn.sign_undefine(list) end --- --- " Remove all the placed signs from all the buffers --- call sign_unplace('*') +--- < --- --- @param group string --- @param dict? vim.fn.sign_unplace.dict @@ -9610,6 +9617,7 @@ function vim.fn.strdisplaywidth(string, col) end --- echo strftime("%H:%M") " 11:55 --- echo strftime("%c", getftime("file.c")) --- " Show mod time of file.c. +--- < --- --- @param format string --- @param time? number @@ -9918,6 +9926,7 @@ function vim.fn.substitute(string, pat, sub, flags) end --- let &directory = '.' --- let swapfiles = swapfilelist() --- let &directory = save_dir +--- < --- --- @return string[] function vim.fn.swapfilelist() end diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua index 2e199c912e..a9dfc699a2 100644 --- a/runtime/lua/vim/treesitter.lua +++ b/runtime/lua/vim/treesitter.lua @@ -430,7 +430,7 @@ end --- Can be used in an ftplugin or FileType autocommand. --- --- Note: By default, disables regex syntax highlighting, which may be required for some plugins. ---- In this case, add `vim.bo.syntax = 'on'` after the call to `start`. +--- In this case, add `vim.bo.syntax = 'ON'` after the call to `start`. --- --- Note: By default, the highlighter parses code asynchronously, using a segment time of 3ms. --- @@ -440,7 +440,7 @@ end --- vim.api.nvim_create_autocmd( 'FileType', { pattern = 'tex', --- callback = function(args) --- vim.treesitter.start(args.buf, 'latex') ---- vim.bo[args.buf].syntax = 'on' -- only if additional legacy syntax is needed +--- vim.bo[args.buf].syntax = 'ON' -- only if additional legacy syntax is needed --- end --- }) --- ``` diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 6754aa82b2..6c12897355 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -3511,7 +3511,7 @@ M.funcs = { Examples: >vim let bufmodified = getbufvar(1, "&mod") echo "todo myvar = " .. getbufvar("todo", "myvar") - + < ]=], name = 'getbufvar', params = { { 'buf', 'integer|string' }, { 'varname', 'string' }, { 'def', 'any' } }, @@ -5047,7 +5047,7 @@ M.funcs = { Examples: >vim let list_is_on = getwinvar(2, '&list') echo "myvar = " .. getwinvar(1, 'myvar') - + < ]=], name = 'getwinvar', params = { { 'winnr', 'integer' }, { 'varname', 'string' }, { 'def', 'any' } }, @@ -5821,7 +5821,7 @@ M.funcs = { Example: >vim let color = inputlist(['Select color:', '1. red', \ '2. green', '3. blue']) - + < ]=], name = 'inputlist', params = { { 'textlist', 'string[]' } }, @@ -6400,7 +6400,7 @@ M.funcs = { object code must be compiled as position-independent ('PIC'). Examples: >vim echo libcall("libc.so", "getenv", "HOME") - + < ]=], name = 'libcall', params = { { 'libname', 'string' }, { 'funcname', 'string' }, { 'argument', 'any' } }, @@ -10256,7 +10256,7 @@ M.funcs = { You can also change the type of a register by appending nothing: >vim call setreg('a', '', 'al') - + < ]=], name = 'setreg', params = { { 'regname', 'string' }, { 'value', 'any' }, { 'options', 'string' } }, @@ -10356,7 +10356,7 @@ M.funcs = { Examples: >vim call setwinvar(1, "&list", 0) call setwinvar(2, "myvar", "foobar") - + < ]=], name = 'setwinvar', params = { { 'nr', 'integer' }, { 'varname', 'string' }, { 'val', 'any' } }, @@ -10861,7 +10861,7 @@ M.funcs = { " Remove all the placed signs from all the buffers call sign_unplace('*') - + < ]=], name = 'sign_unplace', params = { { 'group', 'string' }, { 'dict', 'vim.fn.sign_unplace.dict' } }, @@ -11572,7 +11572,7 @@ M.funcs = { echo strftime("%H:%M") " 11:55 echo strftime("%c", getftime("file.c")) " Show mod time of file.c. - + < ]=], name = 'strftime', params = { { 'format', 'string' }, { 'time', 'number' } }, @@ -11961,6 +11961,7 @@ M.funcs = { let &directory = '.' let swapfiles = swapfilelist() let &directory = save_dir + < ]=], name = 'swapfilelist', params = {},