docs: misc, rename "tabpage"

Co-authored-by: michael-grunder <michael.grunder@gmail.com>
Co-authored-by: Olivia Kinnear <git@superatomic.dev>
Co-authored-by: Felipe Matarazzo <felipemps@protonmail.com>
This commit is contained in:
Justin M. Keyes
2026-04-30 15:01:00 +02:00
parent d12dd07c7a
commit 80d83d75eb
26 changed files with 216 additions and 220 deletions

View File

@@ -366,7 +366,7 @@ podman run \
-v "$PWD:/workdir" \
-w /workdir \
alpine:latest \
sh -c 'apk add build-base cmake coreutils curl gettext-tiny-dev git && make CMAKE_EXTRA_FLAGS="-DSTATIC_BUILD=1"'
sh -c 'apk add build-base cmake coreutils curl gettext-tiny-dev git linux-headers && make CMAKE_EXTRA_FLAGS="-DSTATIC_BUILD=1"'
```
The resulting binary in `build/bin/nvim` will have all the dependencies statically linked:

View File

@@ -1147,30 +1147,31 @@ Syntax When the 'syntax' option has been set. The
See |:syn-on|.
*TabClosed*
TabClosed After closing a tab page. <afile> expands to
the tab page number.
TabClosed After closing a tabpage. <afile> expands to
the closing |tabpage-number|.
*TabClosedPre*
TabClosedPre Before closing a tab page. The window layout
is locked, thus opening and closing of windows
is prohibited.
TabClosedPre Before closing a tabpage. The current tabpage
(|tabpagenr()|) is the one being closed. The
window layout is locked, thus opening and
closing of windows is prohibited.
*TabEnter*
TabEnter Just after entering a tab page. |tab-page|
TabEnter Just after entering a |tabpage|.
After WinEnter.
Before BufEnter.
*TabLeave*
TabLeave Just before leaving a tab page. |tab-page|
TabLeave Just before leaving a |tabpage|.
After WinLeave.
*TabNew*
TabNew When creating a new tab page. |tab-page|
TabNew When creating a new |tabpage|.
After WinEnter.
Before TabEnter.
*TabNewEntered*
TabNewEntered After entering a new tab page. |tab-page|
TabNewEntered After entering a new |tabpage|.
After BufEnter.
*TermClose*
@@ -1381,7 +1382,7 @@ WinLeave Before leaving a window. If the window to be
WinNewPre Before creating a new window. Triggered
before commands that modify window layout by
creating a split.
Not done when creating tab pages and for the
Not done when creating tabpages and for the
first window, as the window structure is not
initialized yet and so is generally not safe.
It is not allowed to modify window layout
@@ -1397,7 +1398,7 @@ WinNew When a new window was created. Not done for
Before WinEnter.
*WinResized*
WinResized After a window in the current tab page changed
WinResized After a window in the current tabpage changed
width or height.
See |win-scrolled-resized|.
@@ -1408,7 +1409,7 @@ WinResized After a window in the current tab page changed
pattern, triggering and recursiveness.
*WinScrolled*
WinScrolled After any window in the current tab page
WinScrolled After any window in the current tabpage
scrolled the text (horizontally or vertically)
or changed width or height. See
|win-scrolled-resized|.

View File

@@ -673,12 +673,11 @@ Lua module: vim.diagnostic *diagnostic-api*
Fields: ~
• {format}? (`fun(counts:table<vim.diagnostic.Severity,integer>): string`)
A function that accepts a mapping of |diagnostic-severity|
to the number of diagnostics of the corresponding severity
(only those severity levels that have at least 1
diagnostic) and returns a 'statusline' component. In this
case highlights must be applied by the user in the `format`
function. Example: >lua
Function that accepts a mapping of |diagnostic-severity| to
the number of diagnostics of the corresponding severity
(only those having at least 1 diagnostic) and returns a
'statusline' component. Highlights must be applied by the
`format` function. Example: >lua
local signs = {
[vim.diagnostic.severity.ERROR] = "A",
-- ...

View File

@@ -30,7 +30,7 @@ By default an internal diff library will be used. When 'diffopt' or
'diffexpr' has been set an external "diff" command will be used. This only
works when such a diff program is available.
Diffs are local to the current tab page |tab-page|. You can't see diffs with
Diffs are local to the current tab page |tabpage|. You can't see diffs with
a window in another tab page. This does make it possible to have several
diffs at the same time, each in their own tab page.

View File

@@ -1147,7 +1147,7 @@ The names can be in upper- or lowercase.
edited.
If there are other tab pages and quitting the last
window in the current tab page the current tab page is
closed |tab-page|.
closed |tabpage|.
Triggers the |QuitPre| autocommand event.
See |CTRL-W_q| for quitting another window.

View File

@@ -4,7 +4,7 @@
NVIM REFERENCE MANUAL
LSP client/framework *lsp* *LSP*
LSP client/framework *lsp* *LSP* *vim.lsp*
Nvim supports the Language Server Protocol (LSP), which means it acts as
a client to LSP servers and includes a Lua framework `vim.lsp` for building
@@ -1657,9 +1657,11 @@ rename({new_name}, {opts}) *vim.lsp.buf.rename()*
*vim.lsp.buf.selection_range()*
selection_range({direction}, {timeout_ms})
Perform an incremental selection at the cursor position based on ranges
given by the LSP. The `direction` parameter specifies the number of times
to expand the selection. Negative values will shrink the selection.
*lsp-incremental-selection*
Expands or contracts a |Visual| selection at cursor, based on ranges given
by LSP. The `direction` parameter specifies the number of times to expand
the selection. Negative values will shrink the selection.
Parameters: ~
• {direction} (`integer`)

View File

@@ -107,7 +107,7 @@ API
• |nvim_echo()| can create |Progress| messages
• |nvim_get_commands()| returns `preview` and `callback` as Lua functions if
they were so specified in `nvim_create_user_command()`.
• |nvim_open_tabpage()| can open a new |tab-page|.
• |nvim_open_tabpage()| can open a new |tabpage|.
• |nvim_open_win()| floating windows can show a 'statusline'. Plugins can use
`style='minimal'` or `:setlocal statusline=` to hide the statusline.
• |nvim_win_set_config()| can move |floating-windows| to other tabpages.

View File

@@ -49,9 +49,6 @@ TREESITTER
UI
• todo
• `vim.ui.img` experimental module added to display images within neovim.
• `:checkhealth vim.ui.img` reports terminal graphics protocol support.
• `vim.ui.img.del(math.huge)` clears all images.
VIMSCRIPT
@@ -131,7 +128,8 @@ DEFAULTS
DIAGNOSTICS
todo
|vim.diagnostic.status()| uses the severity names defined by the `signs`
field of |vim.diagnostic.config()|, if any.
EDITOR
@@ -164,6 +162,8 @@ LSP
LUA
• |vim.ui.img| can display images. Use `:checkhealth img` to confirm your
terminal supports it.
• |vim.net.request()| can specify custom headers by passing `opts.headers`.
• |vim.net.request()| can now accept `method` param overload for multiple HTTP methods.
• |writefile()| treats Lua strings as "blob", so it can be used to write
@@ -221,7 +221,8 @@ TREESITTER
• |v_]N| |v_[N| expand selection to sibling treesitter node.
• |treesitter-highlight-conceal| can be removed by adding a `@noconceal`
capture.
• |vim.treesitter.select()| starts or adjusts a visual selection at cursor, based on tree nodes.
• |vim.treesitter.select()| starts or adjusts a visual selection at cursor,
based on tree nodes.
TUI
@@ -240,9 +241,7 @@ VIMSCRIPT
• |v:exitreason| is set before |QuitPre|.
• |v:starttime| is the process start time (nanoseconds since UNIX epoch).
• |serverlist()| accepts a new `info` option that returns a list of dicts
with `addr`, `pid` and `own` for each server (own + peers),
enabling pickers like the future `:connect` host selector.
• |serverlist()| with `info=true` returns details for each server (own + peers).
==============================================================================
CHANGED FEATURES *news-changed*

View File

@@ -1470,8 +1470,8 @@ A jump table for the options with a short description can be found at |Q_op|.
global or local to tab page
Number of screen lines to use for the command-line. Helps avoiding
|hit-enter| prompts.
The value of this option is stored with the tab page, so that each tab
page can have a different value.
The value of this option is stored with the tabpage, so that each
tabpage can have a different value.
When 'cmdheight' is zero, there is no command-line unless it is being
used. The command-line will cover the last line of the screen when
@@ -2218,7 +2218,7 @@ A jump table for the options with a short description can be found at |Q_op|.
closeoff When a window is closed where 'diff' is set
and there is only one window remaining in the
same tab page with 'diff' set, execute
same tabpage with 'diff' set, execute
`:diffoff` in that window. This undoes a
`:diffsplit` command.
@@ -5411,9 +5411,9 @@ A jump table for the options with a short description can be found at |Q_op|.
will become the current directory (useful with
projects accessed over a network from different
systems)
tabpages all tab pages; without this only the current tab page
tabpages all tabpages; without this only the current tabpage
is restored, so that you can make a session for each
tab page separately
tabpage separately
terminal include terminal windows where the command can be
restored
winpos position of the whole Vim window
@@ -5912,14 +5912,10 @@ A jump table for the options with a short description can be found at |Q_op|.
*'showtabline'* *'stal'*
'showtabline' 'stal' number (default 1)
global
The value of this option specifies when the line with tab page labels
will be displayed:
Specifies when the |tabpage| labels will be displayed:
0: never
1: only if there are at least two tab pages
1: only if there are at least two tabpages
2: always
This is both for the GUI and non-GUI implementation of the tab pages
line.
See |tab-page| for more information about tab pages.
*'sidescroll'* *'ss'*
'sidescroll' 'ss' number (default 1)
@@ -6425,14 +6421,14 @@ A jump table for the options with a short description can be found at |Q_op|.
( - Start of item group. Can be used for setting the width and
alignment of a section. Must be followed by %) somewhere.
) - End of item group. No width fields allowed.
T N For 'tabline': start of tab page N label. Use %T or %X to end
T N For 'tabline': start of tabpage N label. Use %T or %X to end
the label. Clicking this label with left mouse button switches
to the specified tab page, while clicking it with middle mouse
button closes the specified tab page.
to the specified tabpage, while clicking it with middle mouse
button closes the specified tabpage.
X N For 'tabline': start of close tab N label. Use %X or %T to end
the label, e.g.: %3Xclose%X. Use %999X for a "close current
tab" label. Clicking this label with left mouse button closes
the specified tab page.
the specified tabpage.
@ N Start of execute function label. Use %X or %T to end the label,
e.g.: %10@SwitchBuffer@foo.c%X. Clicking this label runs the
specified function: in the example when clicking once using left
@@ -6594,18 +6590,18 @@ A jump table for the options with a short description can be found at |Q_op|.
|:sbnext|, or |:sbrewind|).
Possible values (comma-separated list):
useopen If included, jump to the first open window in the
current tab page that contains the specified buffer
current tabpage that contains the specified buffer
(if there is one). Otherwise: Do not examine other
windows.
usetab Like "useopen", but also consider windows in other tab
pages.
usetab Like "useopen", but also consider windows in other
tabpages.
split If included, split the current window before loading
a buffer for a |quickfix| command that display errors.
Otherwise: do not split, use current window (when used
in the quickfix window: the previously used window or
split if there is no other window).
vsplit Just like "split" but split vertically.
newtab Like "split", but open a new tab page. Overrules
newtab Like "split", but open a new tabpage. Overrules
"split" when both are present.
uselast If included, jump to the previously used window when
jumping to errors with |quickfix| commands.
@@ -6652,27 +6648,27 @@ A jump table for the options with a short description can be found at |Q_op|.
*'tabclose'* *'tcl'*
'tabclose' 'tcl' string (default "")
global
This option controls the behavior when closing tab pages (e.g., using
|:tabclose|). When empty Vim goes to the next (right) tab page.
This option controls the behavior when closing tabpages (e.g., using
|:tabclose|). When empty Vim goes to the next (right) tabpage.
Possible values (comma-separated list):
left If included, go to the previous tab page instead of
left If included, go to the previous tabpage instead of
the next one.
uselast If included, go to the previously used tab page if
uselast If included, go to the previously used tabpage if
possible. This option takes precedence over the
others.
*'tabline'* *'tal'*
'tabline' 'tal' string (default "")
global
When non-empty, this option determines the content of the tab pages
When non-empty, this option determines the content of the tabpages
line at the top of the Vim window. When empty Vim will use a default
tab pages line. See |setting-tabline| for more info.
tabpages line. See |setting-tabline| for more info.
The tab pages line only appears as specified with the 'showtabline'
The tabpages line only appears as specified with the 'showtabline'
option and only when there is no GUI tab line. When 'e' is in
'guioptions' and the GUI supports a tab line 'guitablabel' is used
instead. Note that the two tab pages lines are very different.
instead. Note that the two tabpages lines are very different.
The value is evaluated like with 'statusline'. You can use
|tabpagenr()|, |tabpagewinnr()| and |tabpagebuflist()| to figure out
@@ -6683,13 +6679,13 @@ A jump table for the options with a short description can be found at |Q_op|.
trigger it to be updated, use |:redrawtabline|.
This option cannot be set in a modeline when 'modelineexpr' is off.
Keep in mind that only one of the tab pages is the current one, others
Keep in mind that only one of the tabpages is the current one, others
are invisible and you can't jump to their windows.
*'tabpagemax'* *'tpm'*
'tabpagemax' 'tpm' number (default 50)
global
Maximum number of tab pages to be opened by the |-p| command line
Maximum number of tabpages to be opened by the |-p| command line
argument or the ":tab all" command. |tabpage|
*'tabstop'* *'ts'*

View File

@@ -840,7 +840,7 @@ An example mapping: >
This saves the current Session, and starts off the command to load another.
A session includes all tab pages, unless "tabpages" was removed from
'sessionoptions'. |tab-page|
'sessionoptions'. |tabpage|
The |SessionLoadPre| autocmd event is triggered before a session file is
loaded/sourced and |SessionLoadPost| autocmd event is triggered after.

View File

@@ -13,7 +13,7 @@ when used in combination with more than one tab page.
Type |gO| to see the table of contents.
==============================================================================
1. Introduction *tab-page-intro*
1. Introduction *tabpage-intro*
A tab page holds one or more windows. You can easily switch between tab
pages, so that you have several collections of windows to work on different
@@ -33,18 +33,18 @@ the current window layout. Open a new tab page, do whatever you want to do
and close the tab page.
*tab-ID* *tabid* *tabpageid*
Each tab page has a unique identifier called the tab ID. This identifier will
not change within a Vim session -- even when rearranging tabs.
|nvim_get_current_tabpage()| returns the tab ID and |nvim_list_tabpages()|
lists tab IDs in the order they're displayed. Additionally, the tabs are
numbered from left to right starting at 1: this is the tab number returned by
|tabpagenr()|. However, the tab number may change when tabs are opened,
closed, or rearranged. |nvim_tabpage_get_number()| converts a tab ID to a tab
number.
Each tabpage has an unique identifier which will not change, even after
rearranging tabs. |nvim_get_current_tabpage()| returns the tab-id and
|nvim_list_tabpages()| lists tab-ids in the order they're displayed.
*tabpage-number*
Tabpages are also numbered from left to right starting at 1: this is the tab
"number" returned by |tabpagenr()|, not the tab-id. The tab number may change
when tabs are opened, closed, or rearranged. |nvim_tabpage_get_number()|
converts a tab-id to a tab number.
==============================================================================
2. Commands *tab-page-commands*
2. Commands *tabpage-commands*
OPENING A NEW TAB PAGE:
@@ -302,7 +302,7 @@ LOOPING OVER TAB PAGES:
and |:lfdo|.
==============================================================================
3. Other items *tab-page-other*
3. Other items *tabpage-other*
*tabline-menu*
The GUI tab pages line has a popup menu. It is accessed with a right click.

View File

@@ -640,7 +640,7 @@ in Selects [count]th previous (or first) child node.
[N Expands selection to [count]th previous node.
==============================================================================
VIM.TREESITTER *lua-treesitter*
VIM.TREESITTER *lua-treesitter* *vim.treesitter*
The remainder of this document is a reference manual for the `vim.treesitter`
Lua module, which is the main interface for Nvim's treesitter integration.
@@ -1007,15 +1007,15 @@ get_node({opts}) *vim.treesitter.get_node()*
• {opts} (`table?`) Optional keyword arguments:
• {bufnr} (`integer?`) Buffer number (nil or 0 for current
buffer)
• {ignore_injections} (`boolean?`) Ignore injected languages
(default true)
• {include_anonymous} (`boolean?`) Include anonymous nodes
(default false)
• {lang} (`string?`) Parser language. (default: from buffer
filetype)
• {pos} (`[integer, integer]?`) 0-indexed (row, col) tuple.
Defaults to cursor position in the current window. Required
if {bufnr} is not the current buffer
• {ignore_injections} (`boolean?`, default: true) Ignore
injected languages
• {include_anonymous} (`boolean?`, default: false) Include
anonymous nodes
• {lang} (`string?`, default: from 'filetype') Parser
language.
• {pos} (`[integer, integer]?`, default: window-local cursor)
0-indexed (row, col) tuple. Required if {bufnr} is not the
current buffer
Return: ~
(`TSNode?`) Node at the given position
@@ -1160,15 +1160,16 @@ node_contains({node}, {range}) *vim.treesitter.node_contains()*
Return: ~
(`boolean`) True if the {node} contains the {range}
select({direction}, {opts}) *vim.treesitter.select()*
Starts or adjusts a |Visual| selection at cursor, based on tree nodes.
select({target}, {opts}) *vim.treesitter.select()*
Starts or adjusts a |Visual| selection at cursor, based on tree nodes. The
`target` parameter decides the selection behavior.
Parameters: ~
• {direction} (`'parent'|'child'|'next'|'prev'|'extend_next'|'extend_prev'`)
Direction to select towards
• {opts} (`table?`) A table with the following fields:
• {count} (`integer?`) Number of selections to make in
the given direction (default 1)
• {target} (`'parent'|'child'|'next'|'prev'|'extend_next'|'extend_prev'`)
Decides the selection behavior.
• {opts} (`table?`) A table with the following fields:
• {count} (`integer?`, default: 1) Expand or adjust the
selection this many times.
start({buf}, {lang}) *vim.treesitter.start()*
Starts treesitter highlighting for a buffer

View File

@@ -111,4 +111,6 @@ donate part of the profit to help AIDS victims in Uganda. See |Kuwasha|.
Next chapter: |usr_02.txt| The first steps in Vim
Copyright: see |manual-copyright| vim:tw=78:ts=8:noet:ft=help:norl:
Copyright: see |manual-copyright|
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@@ -596,7 +596,7 @@ A few more things you can do with tab pages:
Closes all tab pages except the current one. Unless there are unsaved
changes in other tab pages.
For more information about tab pages see |tab-page|.
For more information about tabpages see |tabpage|.
==============================================================================

View File

@@ -78,10 +78,10 @@ Multiple windows and buffers. |windows.txt|
can still be loaded (and changed) but not displayed in a window. This
is called a hidden buffer. Many commands and options have been added
for this facility.
Vim can also use multiple tab pages, each with one or more windows. A
Vim can also use multiple tabpages, each with one or more windows. A
line with tab labels can be used to quickly switch between these
pages.
|tab-page|
|tabpage|
Syntax highlighting. |:syntax|
Vim can highlight keywords, patterns and other things. This is

View File

@@ -7,7 +7,7 @@
Visual mode *Visual* *Visual-mode* *visual-mode*
Visual mode is a flexible and easy way to select a piece of text for an
operator. It is the only way to select a block of text.
operator. It is the only way to select a block of text (|visual-block|).
This is introduced in section |04.4| of the user manual.

View File

@@ -61,8 +61,8 @@ empty buffer is created and it is not modified, the buffer will be re-used
when loading another file into that buffer. This also means the buffer number
will not change.
The main Vim window can hold several split windows. There are also tab pages
|tab-page|, each of which can hold multiple windows.
The main Vim window can hold several split windows. There are also
|tabpage|s, each of which can hold multiple windows.
*focusable*
If a window is focusable, it is part of the "navigation stack", that is,
@@ -352,9 +352,8 @@ CTRL-W c *CTRL-W_c* *:clo* *:close*
[!] is used, the buffer becomes hidden (unless there is another
window editing it).
When there is only one |edit-window| in the current tab page
and there is another tab page, this closes the current tab
page. |tab-page|.
When there is only one |edit-window| in the current |tabpage|
and there is another tabpage, this closes the current tabpage.
This command fails when: *E444*
- There is only one window on the screen.
@@ -377,8 +376,8 @@ CTRL-W CTRL-C *CTRL-W_CTRL-C*
The buffer becomes hidden (unless there is another window
editing it or 'bufhidden' is `unload`, `delete` or `wipe`).
If the window is the last one in the current tab page the tab
page is closed. |tab-page|
If the window is the last one in the current |tabpage| the
tabpage is closed.
The value of 'hidden' is irrelevant for this command.
Changes to the buffer are not written and won't get lost, so
@@ -544,13 +543,13 @@ CTRL-W L Move the current window to be at the far right, using the full
is created.
*CTRL-W_T*
CTRL-W T Move the current window to a new tab page. This fails if
there is only one window in the current tab page.
CTRL-W T Move the current window to a new tabpage. This fails if
there is only one window in the current tabpage.
This works like `:tab split`, except the previous window is
closed.
When a count is specified the new tab page will be opened
before the tab page with this index. Otherwise it comes after
the current tab page.
When a count is specified the new tabpage will be opened
before the tabpage with this index. Otherwise it comes after
the current tabpage.
==============================================================================
6. Window resizing *window-resize*

View File

@@ -950,8 +950,8 @@ vim.go.cb = vim.go.clipboard
--- Number of screen lines to use for the command-line. Helps avoiding
--- `hit-enter` prompts.
--- The value of this option is stored with the tab page, so that each tab
--- page can have a different value.
--- The value of this option is stored with the tabpage, so that each
--- tabpage can have a different value.
---
--- When 'cmdheight' is zero, there is no command-line unless it is being
--- used. The command-line will cover the last line of the screen when
@@ -1807,7 +1807,7 @@ vim.go.dex = vim.go.diffexpr
---
--- closeoff When a window is closed where 'diff' is set
--- and there is only one window remaining in the
--- same tab page with 'diff' set, execute
--- same tabpage with 'diff' set, execute
--- `:diffoff` in that window. This undoes a
--- `:diffsplit` command.
---
@@ -5651,9 +5651,9 @@ vim.go.slm = vim.go.selectmode
--- will become the current directory (useful with
--- projects accessed over a network from different
--- systems)
--- tabpages all tab pages; without this only the current tab page
--- tabpages all tabpages; without this only the current tabpage
--- is restored, so that you can make a session for each
--- tab page separately
--- tabpage separately
--- terminal include terminal windows where the command can be
--- restored
--- winpos position of the whole Vim window
@@ -6231,14 +6231,10 @@ vim.o.smd = vim.o.showmode
vim.go.showmode = vim.o.showmode
vim.go.smd = vim.go.showmode
--- The value of this option specifies when the line with tab page labels
--- will be displayed:
--- Specifies when the `tabpage` labels will be displayed:
--- 0: never
--- 1: only if there are at least two tab pages
--- 1: only if there are at least two tabpages
--- 2: always
--- This is both for the GUI and non-GUI implementation of the tab pages
--- line.
--- See `tab-page` for more information about tab pages.
---
--- @type integer
vim.o.showtabline = 1
@@ -6822,14 +6818,14 @@ vim.wo.stc = vim.wo.statuscolumn
--- ( - Start of item group. Can be used for setting the width and
--- alignment of a section. Must be followed by %) somewhere.
--- ) - End of item group. No width fields allowed.
--- T N For 'tabline': start of tab page N label. Use %T or %X to end
--- T N For 'tabline': start of tabpage N label. Use %T or %X to end
--- the label. Clicking this label with left mouse button switches
--- to the specified tab page, while clicking it with middle mouse
--- button closes the specified tab page.
--- to the specified tabpage, while clicking it with middle mouse
--- button closes the specified tabpage.
--- X N For 'tabline': start of close tab N label. Use %X or %T to end
--- the label, e.g.: %3Xclose%X. Use %999X for a "close current
--- tab" label. Clicking this label with left mouse button closes
--- the specified tab page.
--- the specified tabpage.
--- @ N Start of execute function label. Use %X or %T to end the label,
--- e.g.: %10@SwitchBuffer@foo.c%X. Clicking this label runs the
--- specified function: in the example when clicking once using left
@@ -7032,18 +7028,18 @@ vim.bo.swf = vim.bo.swapfile
--- `:sbnext`, or `:sbrewind`).
--- Possible values (comma-separated list):
--- useopen If included, jump to the first open window in the
--- current tab page that contains the specified buffer
--- current tabpage that contains the specified buffer
--- (if there is one). Otherwise: Do not examine other
--- windows.
--- usetab Like "useopen", but also consider windows in other tab
--- pages.
--- usetab Like "useopen", but also consider windows in other
--- tabpages.
--- split If included, split the current window before loading
--- a buffer for a `quickfix` command that display errors.
--- Otherwise: do not split, use current window (when used
--- in the quickfix window: the previously used window or
--- split if there is no other window).
--- vsplit Just like "split" but split vertically.
--- newtab Like "split", but open a new tab page. Overrules
--- newtab Like "split", but open a new tabpage. Overrules
--- "split" when both are present.
--- uselast If included, jump to the previously used window when
--- jumping to errors with `quickfix` commands.
@@ -7107,13 +7103,13 @@ vim.o.syn = vim.o.syntax
vim.bo.syntax = vim.o.syntax
vim.bo.syn = vim.bo.syntax
--- This option controls the behavior when closing tab pages (e.g., using
--- `:tabclose`). When empty Vim goes to the next (right) tab page.
--- This option controls the behavior when closing tabpages (e.g., using
--- `:tabclose`). When empty Vim goes to the next (right) tabpage.
---
--- Possible values (comma-separated list):
--- left If included, go to the previous tab page instead of
--- left If included, go to the previous tabpage instead of
--- the next one.
--- uselast If included, go to the previously used tab page if
--- uselast If included, go to the previously used tabpage if
--- possible. This option takes precedence over the
--- others.
---
@@ -7123,14 +7119,14 @@ vim.o.tcl = vim.o.tabclose
vim.go.tabclose = vim.o.tabclose
vim.go.tcl = vim.go.tabclose
--- When non-empty, this option determines the content of the tab pages
--- When non-empty, this option determines the content of the tabpages
--- line at the top of the Vim window. When empty Vim will use a default
--- tab pages line. See `setting-tabline` for more info.
--- tabpages line. See `setting-tabline` for more info.
---
--- The tab pages line only appears as specified with the 'showtabline'
--- The tabpages line only appears as specified with the 'showtabline'
--- option and only when there is no GUI tab line. When 'e' is in
--- 'guioptions' and the GUI supports a tab line 'guitablabel' is used
--- instead. Note that the two tab pages lines are very different.
--- instead. Note that the two tabpages lines are very different.
---
--- The value is evaluated like with 'statusline'. You can use
--- `tabpagenr()`, `tabpagewinnr()` and `tabpagebuflist()` to figure out
@@ -7141,7 +7137,7 @@ vim.go.tcl = vim.go.tabclose
--- trigger it to be updated, use `:redrawtabline`.
--- This option cannot be set in a modeline when 'modelineexpr' is off.
---
--- Keep in mind that only one of the tab pages is the current one, others
--- Keep in mind that only one of the tabpages is the current one, others
--- are invisible and you can't jump to their windows.
---
--- @type string
@@ -7150,7 +7146,7 @@ vim.o.tal = vim.o.tabline
vim.go.tabline = vim.o.tabline
vim.go.tal = vim.go.tabline
--- Maximum number of tab pages to be opened by the `-p` command line
--- Maximum number of tabpages to be opened by the `-p` command line
--- argument or the ":tab all" command. `tabpage`
---
--- @type integer

View File

@@ -177,10 +177,9 @@ local M = vim._defer_require('vim.diagnostic', {
--- @class vim.diagnostic.Opts.Status
---
--- A function that accepts a mapping of |diagnostic-severity| to the number of
--- diagnostics of the corresponding severity (only those severity levels that
--- have at least 1 diagnostic) and returns a 'statusline' component.
--- In this case highlights must be applied by the user in the `format` function.
--- Function that accepts a mapping of |diagnostic-severity| to the number of diagnostics of the
--- corresponding severity (only those having at least 1 diagnostic) and returns a 'statusline'
--- component. Highlights must be applied by the `format` function.
--- Example:
--- ```lua
--- local signs = {

View File

@@ -1460,7 +1460,9 @@ local function is_empty(range)
return range.start.line == range['end'].line and range.start.character == range['end'].character
end
--- Perform an incremental selection at the cursor position based on ranges given by the LSP. The
--- [lsp-incremental-selection]()
---
--- Expands or contracts a |Visual| selection at cursor, based on ranges given by LSP. The
--- `direction` parameter specifies the number of times to expand the selection. Negative values
--- will shrink the selection.
---

View File

@@ -362,17 +362,20 @@ end
--- Buffer number (nil or 0 for current buffer)
--- @field bufnr integer?
---
--- 0-indexed (row, col) tuple. Defaults to cursor position in the
--- current window. Required if {bufnr} is not the current buffer
--- 0-indexed (row, col) tuple. Required if {bufnr} is not the current buffer
--- (default: window-local cursor)
--- @field pos [integer, integer]?
---
--- Parser language. (default: from buffer filetype)
--- Parser language.
--- (default: from 'filetype')
--- @field lang string?
---
--- Ignore injected languages (default true)
--- Ignore injected languages
--- (default: true)
--- @field ignore_injections boolean?
---
--- Include anonymous nodes (default false)
--- Include anonymous nodes
--- (default: false)
--- @field include_anonymous boolean?
--- Returns the smallest named node at the given position
@@ -512,15 +515,17 @@ end
--- @class vim.treesitter.select.Opts
--- @inlinedoc
---
--- Number of selections to make in the given direction (default 1)
--- Expand or adjust the selection this many times.
--- (default: 1)
--- @field count integer?
--- Starts or adjusts a |Visual| selection at cursor, based on tree nodes.
---@param direction 'parent'|'child'|'next'|'prev'|'extend_next'|'extend_prev' Direction to select
--- towards
--- Starts or adjusts a |Visual| selection at cursor, based on tree nodes. The `target` parameter
--- decides the selection behavior.
---
---@param target 'parent'|'child'|'next'|'prev'|'extend_next'|'extend_prev' Decides the selection behavior.
---@param opts vim.treesitter.select.Opts?
function M.select(direction, opts)
vim.validate('direction', direction, 'string')
function M.select(target, opts)
vim.validate('target', target, 'string')
vim.validate('opts', opts, 'table', true)
opts = opts or {}
if opts.count then
@@ -528,22 +533,20 @@ function M.select(direction, opts)
end
local count = opts.count or 1
if direction == 'parent' then
if target == 'parent' then
return M._select.select_parent(count)
elseif direction == 'child' then
elseif target == 'child' then
return M._select.select_child(count)
elseif direction == 'next' then
elseif target == 'next' then
return M._select.select_next(count)
elseif direction == 'prev' then
elseif target == 'prev' then
return M._select.select_prev(count)
elseif direction == 'extend_next' then
elseif target == 'extend_next' then
return M._select.select_grow_next(count)
elseif direction == 'extend_prev' then
elseif target == 'extend_prev' then
return M._select.select_grow_prev(count)
else
vim.validate('direction', direction, function()
return false, 'Invalid direction'
end)
error(('Invalid target: %s'):format(target))
end
end

View File

@@ -1339,8 +1339,8 @@ local options = {
desc = [=[
Number of screen lines to use for the command-line. Helps avoiding
|hit-enter| prompts.
The value of this option is stored with the tab page, so that each tab
page can have a different value.
The value of this option is stored with the tabpage, so that each
tabpage can have a different value.
When 'cmdheight' is zero, there is no command-line unless it is being
used. The command-line will cover the last line of the screen when
@@ -2393,7 +2393,7 @@ local options = {
closeoff When a window is closed where 'diff' is set
and there is only one window remaining in the
same tab page with 'diff' set, execute
same tabpage with 'diff' set, execute
`:diffoff` in that window. This undoes a
`:diffsplit` command.
@@ -4133,9 +4133,9 @@ local options = {
*'go-d'*
'd' Use dark theme variant if available.
*'go-e'*
'e' Add tab pages when indicated with 'showtabline'.
'e' Add tabpages when indicated with 'showtabline'.
'guitablabel' can be used to change the text in the labels.
When 'e' is missing a non-GUI tab pages line may be used.
When 'e' is missing a non-GUI tabpages line may be used.
The GUI tabs are only supported on some systems, currently
Mac OS/X and MS-Windows.
*'go-i'*
@@ -4203,9 +4203,9 @@ local options = {
abbreviation = 'gtl',
defaults = '',
desc = [=[
When non-empty describes the text to use in a label of the GUI tab
pages line. When empty and when the result is empty Vim will use a
default label. See |setting-guitablabel| for more info.
When non-empty describes the text to use in a label of the GUI
tabpages line. When empty and when the result is empty Vim will use
a default label. See |setting-guitablabel| for more info.
The format of this option is like that of 'statusline'.
'guitabtooltip' is used for the tooltip, see below.
@@ -4213,15 +4213,15 @@ local options = {
modeline, see |sandbox-option|.
This option cannot be set in a modeline when 'modelineexpr' is off.
Only used when the GUI tab pages line is displayed. 'e' must be
present in 'guioptions'. For the non-GUI tab pages line 'tabline' is
Only used when the GUI tabpages line is displayed. 'e' must be
present in 'guioptions'. For the non-GUI tabpages line 'tabline' is
used.
]=],
full_name = 'guitablabel',
modelineexpr = true,
redraw = { 'current_window' },
scope = { 'global' },
short_desc = N_('GUI: custom label for a tab page'),
short_desc = N_('GUI: custom label for a tabpage'),
type = 'string',
immutable = true,
},
@@ -4229,8 +4229,8 @@ local options = {
abbreviation = 'gtt',
defaults = '',
desc = [=[
When non-empty describes the text to use in a tooltip for the GUI tab
pages line. When empty Vim will use a default tooltip.
When non-empty describes the text to use in a tooltip for the GUI
tabpages line. When empty Vim will use a default tooltip.
This option is otherwise just like 'guitablabel' above.
You can include a line break. Simplest method is to use |:let|: >vim
let &guitabtooltip = "line one\nline two"
@@ -4241,7 +4241,7 @@ local options = {
modelineexpr = true,
redraw = { 'current_window' },
scope = { 'global' },
short_desc = N_('GUI: custom tooltip for a tab page'),
short_desc = N_('GUI: custom tooltip for a tabpage'),
type = 'string',
immutable = true,
},
@@ -7453,9 +7453,9 @@ local options = {
will become the current directory (useful with
projects accessed over a network from different
systems)
tabpages all tab pages; without this only the current tab page
tabpages all tabpages; without this only the current tabpage
is restored, so that you can make a session for each
tab page separately
tabpage separately
terminal include terminal windows where the command can be
restored
winpos position of the whole Vim window
@@ -8161,19 +8161,15 @@ local options = {
cb = 'did_set_showtabline',
defaults = 1,
desc = [=[
The value of this option specifies when the line with tab page labels
will be displayed:
Specifies when the |tabpage| labels will be displayed:
0: never
1: only if there are at least two tab pages
1: only if there are at least two tabpages
2: always
This is both for the GUI and non-GUI implementation of the tab pages
line.
See |tab-page| for more information about tab pages.
]=],
full_name = 'showtabline',
redraw = { 'all_windows', 'ui_option' },
scope = { 'global' },
short_desc = N_('tells when the tab pages line is displayed'),
short_desc = N_('tells when the tabpages line is displayed'),
type = 'number',
varname = 'p_stal',
},
@@ -8883,14 +8879,14 @@ local options = {
( - Start of item group. Can be used for setting the width and
alignment of a section. Must be followed by %) somewhere.
) - End of item group. No width fields allowed.
T N For 'tabline': start of tab page N label. Use %T or %X to end
T N For 'tabline': start of tabpage N label. Use %T or %X to end
the label. Clicking this label with left mouse button switches
to the specified tab page, while clicking it with middle mouse
button closes the specified tab page.
to the specified tabpage, while clicking it with middle mouse
button closes the specified tabpage.
X N For 'tabline': start of close tab N label. Use %X or %T to end
the label, e.g.: %3Xclose%X. Use %999X for a "close current
tab" label. Clicking this label with left mouse button closes
the specified tab page.
the specified tabpage.
@ N Start of execute function label. Use %X or %T to end the label,
e.g.: %10@SwitchBuffer@foo.c%X. Clicking this label runs the
specified function: in the example when clicking once using left
@@ -9092,18 +9088,18 @@ local options = {
|:sbnext|, or |:sbrewind|).
Possible values (comma-separated list):
useopen If included, jump to the first open window in the
current tab page that contains the specified buffer
current tabpage that contains the specified buffer
(if there is one). Otherwise: Do not examine other
windows.
usetab Like "useopen", but also consider windows in other tab
pages.
usetab Like "useopen", but also consider windows in other
tabpages.
split If included, split the current window before loading
a buffer for a |quickfix| command that display errors.
Otherwise: do not split, use current window (when used
in the quickfix window: the previously used window or
split if there is no other window).
vsplit Just like "split" but split vertically.
newtab Like "split", but open a new tab page. Overrules
newtab Like "split", but open a new tabpage. Overrules
"split" when both are present.
uselast If included, jump to the previously used window when
jumping to errors with |quickfix| commands.
@@ -9180,20 +9176,20 @@ local options = {
flags = true,
deny_duplicates = true,
desc = [=[
This option controls the behavior when closing tab pages (e.g., using
|:tabclose|). When empty Vim goes to the next (right) tab page.
This option controls the behavior when closing tabpages (e.g., using
|:tabclose|). When empty Vim goes to the next (right) tabpage.
Possible values (comma-separated list):
left If included, go to the previous tab page instead of
left If included, go to the previous tabpage instead of
the next one.
uselast If included, go to the previously used tab page if
uselast If included, go to the previously used tabpage if
possible. This option takes precedence over the
others.
]=],
full_name = 'tabclose',
list = 'onecomma',
scope = { 'global' },
short_desc = N_('which tab page to focus when closing a tab'),
short_desc = N_('which tabpage to focus when closing a tab'),
type = 'string',
varname = 'p_tcl',
flags_varname = 'tcl_flags',
@@ -9203,14 +9199,14 @@ local options = {
cb = 'did_set_tabline',
defaults = '',
desc = [=[
When non-empty, this option determines the content of the tab pages
When non-empty, this option determines the content of the tabpages
line at the top of the Vim window. When empty Vim will use a default
tab pages line. See |setting-tabline| for more info.
tabpages line. See |setting-tabline| for more info.
The tab pages line only appears as specified with the 'showtabline'
The tabpages line only appears as specified with the 'showtabline'
option and only when there is no GUI tab line. When 'e' is in
'guioptions' and the GUI supports a tab line 'guitablabel' is used
instead. Note that the two tab pages lines are very different.
instead. Note that the two tabpages lines are very different.
The value is evaluated like with 'statusline'. You can use
|tabpagenr()|, |tabpagewinnr()| and |tabpagebuflist()| to figure out
@@ -9221,14 +9217,14 @@ local options = {
trigger it to be updated, use |:redrawtabline|.
This option cannot be set in a modeline when 'modelineexpr' is off.
Keep in mind that only one of the tab pages is the current one, others
Keep in mind that only one of the tabpages is the current one, others
are invisible and you can't jump to their windows.
]=],
full_name = 'tabline',
modelineexpr = true,
redraw = { 'tabline' },
scope = { 'global' },
short_desc = N_('custom format for the console tab pages line'),
short_desc = N_('custom format for the console tabpages line'),
type = 'string',
varname = 'p_tal',
},
@@ -9236,12 +9232,12 @@ local options = {
abbreviation = 'tpm',
defaults = 50,
desc = [=[
Maximum number of tab pages to be opened by the |-p| command line
Maximum number of tabpages to be opened by the |-p| command line
argument or the ":tab all" command. |tabpage|
]=],
full_name = 'tabpagemax',
scope = { 'global' },
short_desc = N_('maximum number of tab pages for |-p| and "tab all"'),
short_desc = N_('maximum number of tabpages for |-p| and "tab all"'),
type = 'number',
varname = 'p_tpm',
},

View File

@@ -254,7 +254,7 @@ void pty_proc_resume(PtyProc *ptyproc)
}
/// On Linux, libuv's polling (which uses epoll) doesn't flush PTY master's pending
/// work on kernel workqueue, so use an explcit poll() before that. #37982
/// work on kernel workqueue, so use an explicit poll() before that. #37982
/// Note that poll() only flushes pending work if no data is immediately available,
/// so this function is needed before every libuv poll in flush_stream().
void pty_proc_flush_master(PtyProc *ptyproc)

View File

@@ -56,15 +56,6 @@ describe('nvim_get_commands', function()
it('validation', function()
eq('builtin=true not implemented', pcall_err(api.nvim_get_commands, { builtin = true }))
eq("Invalid key: 'foo'", pcall_err(api.nvim_get_commands, { foo = 'blah' }))
matches(
"Invalid 'desc'",
pcall_err(
exec_lua,
[[
vim.api.nvim_create_user_command('Bad', 'echo "hi"', { desc = 123 })
]]
)
)
end)
it('gets global user-defined commands', function()
@@ -842,7 +833,17 @@ describe('nvim_create_user_command', function()
assert_alive()
end)
it('does not allow invalid command names', function()
it('validation', function()
matches(
"Invalid 'desc'",
pcall_err(
exec_lua,
[[
vim.api.nvim_create_user_command('Bad', 'echo "hi"', { desc = 123 })
]]
)
)
eq(
"Invalid command name (must start with uppercase): 'test'",
pcall_err(

View File

@@ -47,7 +47,7 @@ static void help(void)
puts(" shell-test INTERACT");
puts(" Prints \"interact $ \" to stderr, and waits for \"exit\" input.");
puts(" shell-test HOLD");
puts(" Prints \"holding $ \" to stderr, and waits indefinitely.");
puts(" Prints \"holding $ \" to stderr, and waits indefinitely (without reading stdin, unlike INTERACT).");
puts(" shell-test EXIT {code}");
puts(" Exits immediately with exit code \"{code}\".");
}

View File

@@ -718,7 +718,7 @@ describe('path.c', function()
eq(1, path_with_url([[test+abc-123.ghi://xyz/foo/b1]]))
eq(2, path_with_url([[test+abc-123.ghi:\\xyz\foo\b1]]))
-- Check invalid scheme starting or ending wiht '+', '-', or '.'
-- Check invalid scheme starting or ending with '+', '-', or '.'
eq(0, path_with_url([[-test://xyz/foo/b4]]))
eq(0, path_with_url([[test-://xyz/foo/b5]]))
eq(0, path_with_url([[+test://xyz/foo/b4]]))