diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index a9b7acdb20..1154bb4812 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -124,7 +124,7 @@ CTRL-W Delete the |word| before the cursor. This depends on the 'iskeyword' option. *c_CTRL-U* CTRL-U Remove all characters between the cursor position and - the beginning of the line. Previous versions of vim + the beginning of the line. Previous versions of Vim deleted all characters on the line. If that is the preferred behavior, add the following to your vimrc: > :cnoremap diff --git a/runtime/doc/faq.txt b/runtime/doc/faq.txt index 3dae04d6c3..7e8180d964 100644 --- a/runtime/doc/faq.txt +++ b/runtime/doc/faq.txt @@ -356,7 +356,7 @@ CALLING INPUTLIST(), ECHOMSG, ... IN FILETYPE PLUGINS AND AUTOCMD DOES NOT WORK - https://github.com/vim/vim/issues/4379 This is because Nvim sets `shortmess+=F` by default. Vim behaves the same way -with `set shortmes+=F`. There are plans to improve this, but meanwhile as a +with `set shortmess+=F`. There are plans to improve this, but meanwhile as a workaround, use `set shortmess-=F` or use `unsilent` as follows. >vim unsilent let var = inputlist(['1. item1', '2. item2']) @@ -386,7 +386,7 @@ Or, if you want automatic reloading when assigning to |g:clipboard|, set runtime autoload/provider/clipboard.vim endfunction - if !exists('s:loaded") + if !exists('s:loaded') call dictwatcheradd(g:, 'clipboard', function('s:clipboard_changed')) endif let s:loaded = v:true diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 493e00c956..a1e85a0fb6 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1057,7 +1057,8 @@ Tag Command Command-line editing-mode action ~ under the cursor literally CTRL-S not used, or used for terminal control flow |c_CTRL-T| CTRL-T previous match when 'incsearch' is active -|c_CTRL-U| CTRL-U remove all characters +|c_CTRL-U| CTRL-U remove all characters between the cursor + and beginning of command-line |c_CTRL-V| CTRL-V insert next non-digit literally, insert three digit decimal number as a single byte. |c_CTRL-W| CTRL-W delete the word in front of the cursor diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 32754d61c5..78444dbd33 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1045,7 +1045,8 @@ Short explanation of each option: *option-list* |c_| delete the character in front of the cursor |c_| delete the character under the cursor |c_CTRL-W| CTRL-W delete the word in front of the cursor -|c_CTRL-U| CTRL-U remove all characters +|c_CTRL-U| CTRL-U remove all characters between the cursor + and beginning of command-line |c_| / recall older/newer command-line that starts with current command diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index a6b5b653e3..d8e959acb6 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -755,6 +755,8 @@ Eval: - *err_teapot()* - *js_encode()* - *js_decode()* +- *listener_add()* , etc: use |api-buffer-updates-lua| instead. +- *redraw_listener_add()* , etc: use |nvim_set_decoration_provider()| instead. - *v:none* (used by Vim to represent JavaScript "undefined"); use |v:null| instead. - *v:sizeofint* - *v:sizeoflong* diff --git a/runtime/doc/vimfn.txt b/runtime/doc/vimfn.txt index 35d3b34df9..01472b04c0 100644 --- a/runtime/doc/vimfn.txt +++ b/runtime/doc/vimfn.txt @@ -7851,7 +7851,7 @@ readdir({directory} [, {expr}]) *readdir()* Parameters: ~ • {directory} (`string`) - • {expr} (`integer?`) + • {expr} (`integer|string|fun(name: string): integer?`) Return: ~ (`any`) @@ -8266,7 +8266,7 @@ screencol() *screencol()* < Return: ~ - (`integer[]`) + (`integer`) screenpos({winid}, {lnum}, {col}) *screenpos()* The result is a Dict with the screen position of the text @@ -8298,7 +8298,7 @@ screenpos({winid}, {lnum}, {col}) *screenpos()* • {col} (`integer`) Return: ~ - (`any`) + (`{ col: integer, curscol: integer, endcol: integer, row: integer }`) screenrow() *screenrow()* The result is a Number, which is the current screen row of the @@ -8742,7 +8742,7 @@ searchpos({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]]) • {skip} (`string|function?`) Return: ~ - (`any`) + (`{ [1]: integer, [2]: integer, [3]: integer? }`) serverlist([{opts}]) *serverlist()* Returns a list of server addresses, or empty if all servers diff --git a/runtime/lua/vim/_meta.lua b/runtime/lua/vim/_meta.lua index 02f886cf96..9ac6ceeb77 100644 --- a/runtime/lua/vim/_meta.lua +++ b/runtime/lua/vim/_meta.lua @@ -20,6 +20,7 @@ vim.iter = require('vim.iter') vim.keymap = require('vim.keymap') vim.loader = require('vim.loader') vim.lsp = require('vim.lsp') +vim.net = require('vim.net') vim.pack = require('vim.pack') vim.pos = require('vim.pos') vim.range = require('vim.range') diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index ff05e0a332..1197e8620b 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -1299,15 +1299,15 @@ function vim.api.nvim_get_autocmds(opts) end --- - "stderr" stderr of this Nvim instance --- - "socket" TCP/IP socket or named pipe --- - "job" Job with communication over its stdio. ---- - "mode" How data received on the channel is interpreted. +--- - "mode" How data received on the channel is interpreted. --- - "bytes" Send and receive raw bytes. --- - "terminal" |terminal| instance interprets ASCII sequences. --- - "rpc" |RPC| communication on the channel is active. ---- - "pty" (optional) Name of pseudoterminal. On a POSIX system this is a device path like +--- - "pty" (optional) Name of pseudoterminal. On a POSIX system this is a device path like --- "/dev/pts/1". If unknown, the key will still be present if a pty is used (e.g. --- for conpty on Windows). ---- - "buffer" (optional) Buffer connected to |terminal| instance. ---- - "client" (optional) Info about the peer (client on the other end of the channel), as set +--- - "buffer" (optional) Buffer connected to |terminal| instance. +--- - "client" (optional) Info about the peer (client on the other end of the channel), as set --- by |nvim_set_client_info()|. --- - "exitcode" (optional) Exit code of the |terminal| process. --- diff --git a/runtime/lua/vim/_meta/builtin_types.lua b/runtime/lua/vim/_meta/builtin_types.lua index 47a5242cbb..581926d5f3 100644 --- a/runtime/lua/vim/_meta/builtin_types.lua +++ b/runtime/lua/vim/_meta/builtin_types.lua @@ -60,6 +60,7 @@ --- @field botline integer --- @field bufnr integer --- @field height integer +--- @field leftcol integer --- @field loclist integer --- @field quickfix integer --- @field tabnr integer diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 2c95ae8c92..d012b68556 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -7132,7 +7132,7 @@ function vim.fn.readblob(fname, offset, size) end --- Returns an empty List on error. --- --- @param directory string ---- @param expr? integer +--- @param expr? integer|string|fun(name: string): integer --- @return any function vim.fn.readdir(directory, expr) end @@ -7521,7 +7521,7 @@ function vim.fn.screenchars(row, col) end --- noremap GG echom screencol() --- < --- ---- @return integer[] +--- @return integer function vim.fn.screencol() end --- The result is a Dict with the screen position of the text @@ -7550,7 +7550,7 @@ function vim.fn.screencol() end --- @param winid integer --- @param lnum integer --- @param col integer ---- @return any +--- @return { col: integer, curscol: integer, endcol: integer, row: integer } function vim.fn.screenpos(winid, lnum, col) end --- The result is a Number, which is the current screen row of the @@ -7969,7 +7969,7 @@ function vim.fn.searchpairpos(start, middle, end_, flags, skip, stopline, timeou --- @param stopline? integer --- @param timeout? integer --- @param skip? string|function ---- @return any +--- @return { [1]: integer, [2]: integer, [3]: integer? } function vim.fn.searchpos(pattern, flags, stopline, timeout, skip) end --- Returns a list of server addresses, or empty if all servers diff --git a/runtime/lua/vim/_meta/vvars_extra.lua b/runtime/lua/vim/_meta/vvars_extra.lua index 9fe0be4f27..41dcbce966 100644 --- a/runtime/lua/vim/_meta/vvars_extra.lua +++ b/runtime/lua/vim/_meta/vvars_extra.lua @@ -53,7 +53,7 @@ error('Cannot require a meta file') --- `v:event.operator` is "y". --- @field operator? string --- Text stored in the register as a |readfile()|-style list of lines. ---- @field regcontents? string +--- @field regcontents? string|string[] --- Requested register (e.g "x" for "xyy) or the empty string for an unnamed operation. --- @field regname? string --- @field regtype? string Type of register as returned by |getregtype()|. diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 1c5ffb5c0e..a28fca5d3d 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -1709,15 +1709,15 @@ void nvim_set_client_info(uint64_t channel_id, String name, Dict version, String /// - "stderr" stderr of this Nvim instance /// - "socket" TCP/IP socket or named pipe /// - "job" Job with communication over its stdio. -/// - "mode" How data received on the channel is interpreted. +/// - "mode" How data received on the channel is interpreted. /// - "bytes" Send and receive raw bytes. /// - "terminal" |terminal| instance interprets ASCII sequences. /// - "rpc" |RPC| communication on the channel is active. -/// - "pty" (optional) Name of pseudoterminal. On a POSIX system this is a device path like +/// - "pty" (optional) Name of pseudoterminal. On a POSIX system this is a device path like /// "/dev/pts/1". If unknown, the key will still be present if a pty is used (e.g. /// for conpty on Windows). -/// - "buffer" (optional) Buffer connected to |terminal| instance. -/// - "client" (optional) Info about the peer (client on the other end of the channel), as set +/// - "buffer" (optional) Buffer connected to |terminal| instance. +/// - "client" (optional) Info about the peer (client on the other end of the channel), as set /// by |nvim_set_client_info()|. /// - "exitcode" (optional) Exit code of the |terminal| process. /// diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 099dd418e9..9cd17b9a3a 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -8669,7 +8669,7 @@ M.funcs = { ]=], name = 'readdir', - params = { { 'directory', 'string' }, { 'expr', 'integer' } }, + params = { { 'directory', 'string' }, { 'expr', 'integer|string|fun(name: string): integer' } }, signature = 'readdir({directory} [, {expr}])', }, readfile = { @@ -9176,7 +9176,7 @@ M.funcs = { ]=], name = 'screencol', params = {}, - returns = 'integer[]', + returns = 'integer', signature = 'screencol()', }, screenpos = { @@ -9209,6 +9209,7 @@ M.funcs = { ]=], name = 'screenpos', params = { { 'winid', 'integer' }, { 'lnum', 'integer' }, { 'col', 'integer' } }, + returns = '{ col: integer, curscol: integer, endcol: integer, row: integer }', signature = 'screenpos({winid}, {lnum}, {col})', }, screenrow = { @@ -9671,6 +9672,7 @@ M.funcs = { { 'timeout', 'integer' }, { 'skip', 'string|function' }, }, + returns = '{ [1]: integer, [2]: integer, [3]: integer? }', signature = 'searchpos({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])', }, serverlist = {