aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-12-03 09:44:28 -0800
committerGitHub <noreply@github.com>2024-12-03 09:44:28 -0800
commitae93c7f369a174f3d738ab55030de2c9dfc10c57 (patch)
treeedda44dff7261c3b28e47f9493d8aba998ce482d /src
parent2495e7e22a0d56911d3677a17de3ff946b68a9a1 (diff)
downloadrneovim-ae93c7f369a174f3d738ab55030de2c9dfc10c57.tar.gz
rneovim-ae93c7f369a174f3d738ab55030de2c9dfc10c57.tar.bz2
rneovim-ae93c7f369a174f3d738ab55030de2c9dfc10c57.zip
docs: misc, help tags for neovim.io searches #31428
Problem: Various keywords are commonly searched-for on https://neovim.io, but don't have help tags. Solution: Add help tags. fix #31327
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/vim.c14
-rw-r--r--src/nvim/eval.lua8
2 files changed, 18 insertions, 4 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index ab52612f9f..1262af5e40 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -1040,7 +1040,7 @@ fail:
/// Open a terminal instance in a buffer
///
/// By default (and currently the only option) the terminal will not be
-/// connected to an external process. Instead, input send on the channel
+/// connected to an external process. Instead, input sent on the channel
/// will be echoed directly by the terminal. This is useful to display
/// ANSI terminal sequences returned as part of a rpc message, or similar.
///
@@ -1051,6 +1051,18 @@ fail:
/// Then |nvim_chan_send()| can be called immediately to process sequences
/// in a virtual terminal having the intended size.
///
+/// Example: this `TermHl` command can be used to display and highlight raw ANSI termcodes, so you
+/// can use Nvim as a "scrollback pager" (for terminals like kitty): [terminal-scrollback-pager]()
+///
+/// ```lua
+/// vim.api.nvim_create_user_command('TermHl', function()
+/// local b = vim.api.nvim_create_buf(false, true)
+/// local chan = vim.api.nvim_open_term(b, {})
+/// vim.api.nvim_chan_send(chan, table.concat(vim.api.nvim_buf_get_lines(0, 0, -1, false), '\n'))
+/// vim.api.nvim_win_set_buf(0, b)
+/// end, { desc = 'Highlights ANSI termcodes in curbuf' })
+/// ```
+///
/// @param buffer the buffer to use (expected to be empty)
/// @param opts Optional parameters.
/// - on_input: Lua callback for input sent, i e keypresses in terminal
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
index cd3ccf543e..08c9cd3991 100644
--- a/src/nvim/eval.lua
+++ b/src/nvim/eval.lua
@@ -6049,6 +6049,7 @@ M.funcs = {
]=],
name = 'jobwait',
params = { { 'jobs', 'integer[]' }, { 'timeout', 'integer' } },
+ returns = 'integer[]',
signature = 'jobwait({jobs} [, {timeout}])',
},
join = {
@@ -8776,7 +8777,7 @@ M.funcs = {
<
]=],
name = 'rpcnotify',
- params = { { 'channel', 'integer' }, { 'event', 'string' }, { 'args', 'any' } },
+ params = { { 'channel', 'integer' }, { 'event', 'string' }, { '...', 'any' } },
signature = 'rpcnotify({channel}, {event} [, {args}...])',
},
rpcrequest = {
@@ -8789,7 +8790,7 @@ M.funcs = {
<
]=],
name = 'rpcrequest',
- params = { { 'channel', 'integer' }, { 'method', 'string' }, { 'args', 'any' } },
+ params = { { 'channel', 'integer' }, { 'method', 'string' }, { '...', 'any' } },
signature = 'rpcrequest({channel}, {method} [, {args}...])',
},
rpcstart = {
@@ -11155,7 +11156,7 @@ M.funcs = {
and exists only for backwards-compatibility.
With UTF-8 composing characters are handled properly: >vim
echo str2list("á") " returns [97, 769]
-
+ <
]=],
name = 'str2list',
params = { { 'string', 'string' }, { 'utf8', 'boolean' } },
@@ -13091,6 +13092,7 @@ M.funcs = {
]=],
name = 'winlayout',
params = { { 'tabnr', 'integer' } },
+ returns = 'any[]',
signature = 'winlayout([{tabnr}])',
},
winline = {