backport: docs: misc, window (#39722)

- formalize `window-number` similar to `tabpage-number`.
- reference it from docs.
This commit is contained in:
Justin M. Keyes
2026-05-11 17:06:59 -04:00
committed by GitHub
parent 5b8268356a
commit 25b522a75d
12 changed files with 227 additions and 210 deletions

View File

@@ -346,8 +346,7 @@ OPTIONS
in the cmdline message area.
• Improved |:set+=|, |:set^=| and |:set-=| handling of comma-separated "key:value"
pairs (e.g. 'listchars', 'fillchars', 'diffopt').
• 'ttyfast' can be disabled during startup by setting the environment variable
`NVIM_NOTTYFAST` to disable automatic background detection.
• 'ttyfast' can be disabled during startup by setting |$NVIM_NOTTYFAST|.
PERFORMANCE

View File

@@ -6420,7 +6420,7 @@ A jump table for the options with a short description can be found at |Q_op|.
added without modifying code that reacts on mouse clicks on
this label.
Use |getmousepos()|.winid in the specified function to get the
corresponding window id of the clicked item.
corresponding |window-ID| of the clicked item.
< - Where to truncate line if too long. Default is at the start.
No width fields allowed.
= - Separation point between alignment sections. Each section will
@@ -6979,15 +6979,22 @@ A jump table for the options with a short description can be found at |Q_op|.
used for CTRL-\ CTRL-N and CTRL-\ CTRL-G when part of a command has
been typed.
*'ttyfast'* *'tf'* *'nottyfast'* *'notf'*
*'ttyfast'* *'tf'* *'nottyfast'* *'notf'* *E1568* *$NVIM_NOTTYFAST*
'ttyfast' 'tf' boolean (default on)
global
Assume that the underlying terminal can respond quickly to queries
required by features such as 'background' detection.
Enables Nvim |TUI| features which assume a fast (usually local) host
terminal. During startup, Nvim queries the terminal (for 'background'
detection, etc.) and must wait for a response (or timeout).
Nvim issues terminal queries before reading the user's |config| file,
so disabling this option there will not work. Set $NVIM_NOTTYFAST
before starting Nvim to disable terminal queries.
If your terminal environment is slow (e.g. remote SSH), or broken
(doesn't respond to queries), Nvim startup may be slower. Therefore
you can disable this option by setting the `$NVIM_NOTTYFAST`
environment variable before starting Nvim: >
NVIM_NOTTYFAST=1 nvim
<
The queries are performed early, before |--cmd| and user |config|, so
`:set nottyfast` in your config happens too late.
*'undodir'* *'udir'* *E5003*
'undodir' 'udir' string (default "$XDG_STATE_HOME/nvim/undo//")

View File

@@ -90,7 +90,7 @@ Defaults *defaults* *nvim-defaults*
- 'ttimeoutlen' defaults to 50
- 'ttyfast' is set by default, but it can be unset during startup by setting
the environment variable `NVIM_NOTTYFAST` to adjust the startup sequence for
slow environments.
slow environments (such as ssh).
- 'undodir' defaults to ~/.local/state/nvim/undo// (|xdg|), auto-created
- 'viewoptions' includes "unix,slash", excludes "options"
- 'viminfo' includes "!"

View File

@@ -151,8 +151,8 @@ argc([{winid}]) *argc()*
If {winid} is not supplied, the argument list of the current
window is used.
If {winid} is -1, the global argument list is used.
Otherwise {winid} specifies the window of which the argument
list is used: either the window number or the window ID.
Otherwise {winid} (a |window-number| or |window-ID|) specifies
the window of which the argument list is used.
Returns -1 if the {winid} argument is invalid.
Parameters: ~
@@ -178,7 +178,7 @@ arglistid([{winnr} [, {tabnr}]]) *arglistid()*
With {winnr} only use this window in the current tabpage.
With {winnr} and {tabnr} use the window in the specified tab
page.
{winnr} can be the window number or the |window-ID|.
{winnr} is a |window-number| or |window-ID|.
Parameters: ~
• {winnr} (`integer?`)
@@ -199,7 +199,7 @@ argv([{nr} [, {winid}]]) *argv()*
< Without the {nr} argument, or when {nr} is -1, a |List| with
the whole |arglist| is returned.
The {winid} argument specifies the window ID, see |argc()|.
The {winid} argument is a |window-ID|, see |argc()|.
For the Vim command line arguments see |v:argv|.
Returns an empty string if {nr}th argument is not present in
@@ -731,7 +731,7 @@ bufwinid({buf}) *bufwinid()*
(`integer`)
bufwinnr({buf}) *bufwinnr()*
Like |bufwinid()| but return the window number instead of the
Like |bufwinid()| but returns a |window-number| instead of a
|window-ID|.
If buffer {buf} doesn't exist or there is no such window, -1
is returned. Example: >vim
@@ -1071,8 +1071,8 @@ cindent({lnum}) *cindent()*
clearmatches([{win}]) *clearmatches()*
Clears all matches previously defined for the current window
by |matchadd()| and the |:match| commands.
If {win} is specified, use the window with this number or
window ID instead of the current window.
If {win} is specified, use this |window-number| or |window-ID|
instead of the current window.
Parameters: ~
• {win} (`integer?`)
@@ -3523,10 +3523,10 @@ getcurpos([{winid}]) *getcurpos()*
the cursor is returned in "col". To get the character
position, use |getcursorcharpos()|.
The optional {winid} argument can specify the window. It can
be the window number or the |window-ID|. The last known
cursor position is returned, this may be invalid for the
current value of the buffer if it is not the current window.
The optional {winid} (|window-number| or |window-ID|) specifies
the window. The last known cursor position is returned, this
may be invalid for the current value of the buffer if it is not
the current window.
If {winid} is invalid a list with zeroes is returned.
This can be used to save and restore the cursor position: >vim
@@ -3568,7 +3568,7 @@ getcwd([{winnr} [, {tabnr}]]) *getcwd()*
getcwd(0)
getcwd(0, 0)
< If {winnr} is -1 it is ignored, only the tab is resolved.
{winnr} can be the window number or the |window-ID|.
{winnr} is a |window-number| or |window-ID|.
If both {winnr} and {tabnr} are -1 the global working
directory is returned.
Note: When {tabnr} is -1 Vim returns an empty string to
@@ -3695,8 +3695,8 @@ getjumplist([{winnr} [, {tabnr}]]) *getjumplist()*
Returns the |jumplist| for the specified window.
Without arguments use the current window.
With {winnr} only use this window in the current tabpage.
{winnr} can also be a |window-ID|.
With {winnr} (|window-number| or |window-ID|) only use this
window in the current tabpage.
With {winnr} and {tabnr} use the window in the specified tab
page. If {winnr} or {tabnr} is invalid, an empty list is
returned.
@@ -3752,12 +3752,12 @@ getline({lnum} [, {end}]) *getline()*
getloclist({nr} [, {what}]) *getloclist()*
Returns a |List| with all the entries in the location list for
window {nr}. {nr} can be the window number or the |window-ID|.
window {nr} (|window-number| or |window-ID|).
When {nr} is zero the current window is used.
For a location list window, the displayed location list is
returned. For an invalid window number {nr}, an empty list is
returned. Otherwise, same as |getqflist()|.
returned. For an invalid {nr}, an empty list is returned.
Otherwise, same as |getqflist()|.
If the optional {what} dictionary argument is supplied, then
returns the items listed in {what} as a dictionary. Refer to
@@ -3820,9 +3820,9 @@ getmatches([{win}]) *getmatches()*
|getmatches()| is useful in combination with |setmatches()|,
as |setmatches()| can restore a list of matches saved by
|getmatches()|.
If {win} is specified, use the window with this number or
window ID instead of the current window. If {win} is invalid,
an empty list is returned.
If {win} is specified, use this |window-number| or |window-ID|
instead of the current window. If {win} is invalid, an empty
list is returned.
Example: >vim
echo getmatches()
< >
@@ -4366,7 +4366,7 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()*
Note that {varname} must be the name without "w:".
Tabs are numbered starting with one. For the current tabpage
use |getwinvar()|.
{winnr} can be the window number or the |window-ID|.
{winnr} is a |window-number| or |window-ID|.
When {winnr} is zero the current window is used.
This also works for a global option, buffer-local option and
window-local option, but it doesn't work for a global variable
@@ -4391,8 +4391,8 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()*
(`any`)
gettagstack([{winnr}]) *gettagstack()*
Returns the tag stack of window {winnr} as a Dict.
{winnr} can be the window number or the |window-ID|.
Returns the tag stack of window {winnr} (|window-number| or
|window-ID|) as a Dict.
When {winnr} is not specified, the current window is used.
When window {winnr} doesn't exist, an empty Dict is returned.
@@ -4474,7 +4474,7 @@ getwininfo([{winid}]) *getwininfo()*
wincol leftmost screen column of the window;
"col" from |win_screenpos()|
winid |window-ID|
winnr window number
winnr |window-number|
winrow topmost screen line of the window;
"row" from |win_screenpos()|
@@ -4758,7 +4758,7 @@ haslocaldir([{winnr} [, {tabnr}]]) *haslocaldir()*
echo haslocaldir(0, 0)
< With {winnr} use that window in the current tabpage.
With {winnr} and {tabnr} use the window in that tabpage.
{winnr} can be the window number or the |window-ID|.
{winnr} is a |window-number| or |window-ID|.
If {winnr} is -1 it is ignored, only the tab is resolved.
Throw error if the arguments are invalid. |E5000| |E5001| |E5002|
@@ -6314,8 +6314,8 @@ matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]])
conceal Special character to show instead of the
match (only for |hl-Conceal| highlighted
matches, see |:syn-cchar|)
window Instead of the current window use the
window with this number or window ID.
window Use this |window-number| or |window-ID| instead
of the current window.
The number of matches is not limited, as it is the case with
the |:match| commands.
@@ -6466,8 +6466,7 @@ matchdelete({id} [, {win}]) *matchdelete()* *E802* *E
or one of the |:match| commands. Returns 0 if successful,
otherwise -1. See example for |matchadd()|. All matches can
be deleted in one operation by |clearmatches()|.
If {win} is specified, use the window with this number or
window ID instead of the current window.
{win} (if given) is a |window-number| or |window-ID|.
Parameters: ~
• {id} (`integer`)
@@ -9111,12 +9110,12 @@ setline({lnum}, {text}) *setline()*
(`any`)
setloclist({nr}, {list} [, {action} [, {what}]]) *setloclist()*
Create or replace or add to the location list for window {nr}.
{nr} can be the window number or the |window-ID|.
Create or replace or add to the location list for window {nr}
(|window-number| or |window-ID|).
When {nr} is zero the current window is used.
For a location list window, the displayed location list is
modified. For an invalid window number {nr}, -1 is returned.
modified. For an invalid {nr}, -1 is returned.
Otherwise, same as |setqflist()|.
Also see |location-list|.
@@ -9140,8 +9139,7 @@ setmatches({list} [, {win}]) *setmatches()*
current window. Returns 0 if successful, otherwise -1. All
current matches are cleared before the list is restored. See
example for |getmatches()|.
If {win} is specified, use the window with this number or
window ID instead of the current window.
{win} (if given) is a |window-number| or |window-ID|.
Parameters: ~
• {list} (`vim.fn.getmatches.ret.item[]`)
@@ -9421,7 +9419,7 @@ settabwinvar({tabnr}, {winnr}, {varname}, {val}) *settabwinvar()*
{val}.
Tabs are numbered starting with one. For the current tabpage
use |setwinvar()|.
{winnr} can be the window number or the |window-ID|.
{winnr} is a |window-number| or |window-ID|.
When {winnr} is zero the current window is used.
This also works for a global or local buffer option, but it
doesn't work for a global or local buffer variable.
@@ -9442,8 +9440,8 @@ settabwinvar({tabnr}, {winnr}, {varname}, {val}) *settabwinvar()*
(`any`)
settagstack({nr}, {dict} [, {action}]) *settagstack()*
Modify the tag stack of the window {nr} using {dict}.
{nr} can be the window number or the |window-ID|.
Modify the tag stack of the window {nr} (|window-number| or
|window-ID|) using {dict}.
For a list of supported items in {dict}, refer to
|gettagstack()|. "curidx" takes effect before changing the tag
@@ -11853,8 +11851,8 @@ virtcol2col({winid}, {lnum}, {col}) *virtcol2col()*
For a multi-byte character, the column number of the first
byte in the character is returned.
The {winid} argument can be the window number or the
|window-ID|. If this is zero, then the current window is used.
{winid} is a |window-number| or |window-ID|. If zero, the
current window is used.
Returns -1 if the window {winid} doesn't exist or the buffer
line {lnum} or virtual column {col} is invalid.
@@ -11990,10 +11988,9 @@ win_findbuf({bufnr}) *win_findbuf()*
win_getid([{win} [, {tab}]]) *win_getid()*
Get the |window-ID| for the specified window.
When {win} is missing use the current window.
With {win} this is the window number. The top window has
number 1.
Without {tab} use the current tab, otherwise the tab with
number {tab}. The first tab has number one.
With {win} this is the |window-number|.
Without {tab} use the current tab, otherwise the
|tabpage-number| given by {tab}.
Return zero if the window cannot be found.
Parameters: ~
@@ -12016,8 +12013,8 @@ win_gettype([{nr}]) *win_gettype()*
"unknown" window {nr} not found
When {nr} is omitted return the type of the current window.
When {nr} is given return the type of this window by number or
|window-ID|.
When {nr} is given (|window-number| or |window-ID|) return the
type of that window.
Also see the 'buftype' option.
@@ -12028,8 +12025,7 @@ win_gettype([{nr}]) *win_gettype()*
(`'autocmd'|'command'|''|'loclist'|'popup'|'preview'|'quickfix'|'unknown'`)
win_gotoid({expr}) *win_gotoid()*
Go to window with ID {expr}. This may also change the current
tabpage.
Go to |window-ID| {expr}. May change the current tabpage.
Return TRUE if successful, FALSE if the window cannot be
found.
@@ -12040,8 +12036,8 @@ win_gotoid({expr}) *win_gotoid()*
(`0|1`)
win_id2tabwin({expr}) *win_id2tabwin()*
Return a list with the tab number and window number of window
with ID {expr}: [tabnr, winnr].
Return [tabnr, winnr] for window with |window-ID| {expr}, where
tabnr is the |tabpage-number| and winnr is the |window-number|.
Return [0, 0] if the window cannot be found.
Parameters: ~
@@ -12051,7 +12047,7 @@ win_id2tabwin({expr}) *win_id2tabwin()*
(`any`)
win_id2win({expr}) *win_id2win()*
Return the window number of window with ID {expr}.
Return the |window-number| of for the given |window-ID| {expr}.
Return 0 if the window cannot be found in the current tabpage.
Parameters: ~
@@ -12063,7 +12059,7 @@ win_id2win({expr}) *win_id2win()*
win_move_separator({nr}, {offset}) *win_move_separator()*
Move window {nr}'s vertical separator (i.e., the right border)
by {offset} columns, as if being dragged by the mouse. {nr}
can be a window number or |window-ID|. A positive {offset}
is a |window-number| or |window-ID|. A positive {offset}
moves right and a negative {offset} moves left. Moving a
window's vertical separator will change the width of the
window and the width of other windows adjacent to the vertical
@@ -12084,8 +12080,8 @@ win_move_separator({nr}, {offset}) *win_move_separator()*
win_move_statusline({nr}, {offset}) *win_move_statusline()*
Move window {nr}'s status line (i.e., the bottom border) by
{offset} rows, as if being dragged by the mouse. {nr} can be
a window number or |window-ID|. A positive {offset} moves
{offset} rows, as if being dragged by the mouse. {nr} is a
|window-number| or |window-ID|. A positive {offset} moves
down and a negative {offset} moves up. Moving a window's
status line will change the height of the window and the
height of other windows adjacent to the status line. The
@@ -12105,8 +12101,8 @@ win_screenpos({nr}) *win_screenpos()*
Return the screen position of window {nr} as a list with two
numbers: [row, col]. The first window always has position
[1, 1], unless there is a tabline, then it is [2, 1].
{nr} can be the window number or the |window-ID|. Use zero
for the current window.
{nr} is a |window-number| or |window-ID|. Use zero for the
current window.
Returns [0, 0] if the window cannot be found.
Parameters: ~
@@ -12121,7 +12117,7 @@ win_splitmove({nr}, {target} [, {options}]) *win_splitmove()*
Unlike commands such as |:split|, no new windows are created
(the |window-ID| of window {nr} is unchanged after the move).
Both {nr} and {target} can be window numbers or |window-ID|s.
Both {nr} and {target} are a |window-number| or |window-ID|.
Both must be in the current tabpage.
Returns zero for success, non-zero for failure.
@@ -12144,8 +12140,8 @@ win_splitmove({nr}, {target} [, {options}]) *win_splitmove()*
(`any`)
winbufnr({nr}) *winbufnr()*
Returns the buffer number associated with window {nr}.
{nr} can be the window number or the |window-ID|.
Returns the buffer number associated with window {nr}
(|window-number| or |window-ID|).
When {nr} is zero, the number of the buffer in the current
window is returned.
When window {nr} doesn't exist, -1 is returned.

View File

@@ -78,15 +78,16 @@ Windows (especially floating windows) can have many other |api-win_config|
properties such as "hide" and "fixed" which also affect behavior.
*window-ID* *winid* *windowid*
Each window has a unique identifier called the window ID. This identifier
will not change within a Vim session. The |win_getid()| and |win_id2tabwin()|
functions can be used to convert between the window/tab number and the
identifier. There is also the window number, which may change whenever
windows are opened or closed, see |winnr()|.
The window number is only valid in one specific tab. The window ID is valid
across tabs. For most functions that take a window ID or a window number, the
window number only applies to the current tab, while the window ID can refer
to a window in any tab.
Each window has a unique identifier called the window ID, which is permanent
during the Nvim session. The |win_getid()| and |win_id2tabwin()| functions
convert between the window/tab "number" and the identifier.
*window-number*
Windows are also numbered according to their arrangement in a tabpage; this
window "number" is given by |winnr()| and may change whenever windows are
opened or closed. The window number is only valid in one specific tab, whereas
the window ID is valid globally, across tabs. For most functions that take
a window ID or a window number, the window number only applies to the current
tab, while the window ID can refer to a window in any tab.
==============================================================================

View File

@@ -461,11 +461,11 @@ do
vim.keymap.set({ 'x' }, '[N', function()
require 'vim.treesitter._select'.select_grow_prev(vim.v.count1)
end, { desc = 'Select expand previous node' })
end, { desc = 'Select previous sibling node' })
vim.keymap.set({ 'x' }, ']N', function()
require 'vim.treesitter._select'.select_grow_next(vim.v.count1)
end, { desc = 'Select expand next node' })
end, { desc = 'Select next sibling node' })
vim.keymap.set({ 'x', 'o' }, 'an', function()
if vim.treesitter.get_parser(nil, nil, { error = false }) then
@@ -995,7 +995,7 @@ do
and os.getenv('NVIM_TEST') == nil
then
vim.notify(
"defaults.lua: Did not detect DSR response from terminal for 'background' detection. This results in a slower startup time. To disable this and other 'ttyfast' features during startup, set the environment variable NVIM_NOTTYFAST",
"E1568: Terminal did not respond to DSR request for 'background' color. Startup may be slower. :help 'ttyfast'",
vim.log.levels.WARN,
{ _truncate = true }
)

View File

@@ -6808,7 +6808,7 @@ vim.wo.stc = vim.wo.statuscolumn
--- added without modifying code that reacts on mouse clicks on
--- this label.
--- Use `getmousepos()`.winid in the specified function to get the
--- corresponding window id of the clicked item.
--- corresponding `window-ID` of the clicked item.
--- \< - Where to truncate line if too long. Default is at the start.
--- No width fields allowed.
--- = - Separation point between alignment sections. Each section will
@@ -7517,12 +7517,20 @@ vim.o.ttm = vim.o.ttimeoutlen
vim.go.ttimeoutlen = vim.o.ttimeoutlen
vim.go.ttm = vim.go.ttimeoutlen
--- Assume that the underlying terminal can respond quickly to queries
--- required by features such as 'background' detection.
--- Enables Nvim `TUI` features which assume a fast (usually local) host
--- terminal. During startup, Nvim queries the terminal (for 'background'
--- detection, etc.) and must wait for a response (or timeout).
---
--- Nvim issues terminal queries before reading the user's `config` file,
--- so disabling this option there will not work. Set $NVIM_NOTTYFAST
--- before starting Nvim to disable terminal queries.
--- If your terminal environment is slow (e.g. remote SSH), or broken
--- (doesn't respond to queries), Nvim startup may be slower. Therefore
--- you can disable this option by setting the `$NVIM_NOTTYFAST`
--- environment variable before starting Nvim:
--- ```
--- NVIM_NOTTYFAST=1 nvim
--- ```
---
--- The queries are performed early, before `--cmd` and user `config`, so
--- `:set nottyfast` in your config happens too late.
---
--- @type boolean
vim.o.ttyfast = true

View File

@@ -122,8 +122,8 @@ function vim.fn.appendbufline(buf, lnum, text) end
--- If {winid} is not supplied, the argument list of the current
--- window is used.
--- If {winid} is -1, the global argument list is used.
--- Otherwise {winid} specifies the window of which the argument
--- list is used: either the window number or the window ID.
--- Otherwise {winid} (a |window-number| or |window-ID|) specifies
--- the window of which the argument list is used.
--- Returns -1 if the {winid} argument is invalid.
---
--- @param winid? integer
@@ -145,7 +145,7 @@ function vim.fn.argidx() end
--- With {winnr} only use this window in the current tabpage.
--- With {winnr} and {tabnr} use the window in the specified tab
--- page.
--- {winnr} can be the window number or the |window-ID|.
--- {winnr} is a |window-number| or |window-ID|.
---
--- @param winnr? integer
--- @param tabnr? integer
@@ -163,7 +163,7 @@ function vim.fn.arglistid(winnr, tabnr) end
--- <Without the {nr} argument, or when {nr} is -1, a |List| with
--- the whole |arglist| is returned.
---
--- The {winid} argument specifies the window ID, see |argc()|.
--- The {winid} argument is a |window-ID|, see |argc()|.
--- For the Vim command line arguments see |v:argv|.
---
--- Returns an empty string if {nr}th argument is not present in
@@ -633,7 +633,7 @@ function vim.fn.bufnr(buf, create) end
--- @return integer
function vim.fn.bufwinid(buf) end
--- Like |bufwinid()| but return the window number instead of the
--- Like |bufwinid()| but returns a |window-number| instead of a
--- |window-ID|.
--- If buffer {buf} doesn't exist or there is no such window, -1
--- is returned. Example: >vim
@@ -930,8 +930,8 @@ function vim.fn.cindent(lnum) end
--- Clears all matches previously defined for the current window
--- by |matchadd()| and the |:match| commands.
--- If {win} is specified, use the window with this number or
--- window ID instead of the current window.
--- If {win} is specified, use this |window-number| or |window-ID|
--- instead of the current window.
---
--- @param win? integer
function vim.fn.clearmatches(win) end
@@ -3165,10 +3165,10 @@ function vim.fn.getcompletiontype(pat) end
--- the cursor is returned in "col". To get the character
--- position, use |getcursorcharpos()|.
---
--- The optional {winid} argument can specify the window. It can
--- be the window number or the |window-ID|. The last known
--- cursor position is returned, this may be invalid for the
--- current value of the buffer if it is not the current window.
--- The optional {winid} (|window-number| or |window-ID|) specifies
--- the window. The last known cursor position is returned, this
--- may be invalid for the current value of the buffer if it is not
--- the current window.
--- If {winid} is invalid a list with zeroes is returned.
---
--- This can be used to save and restore the cursor position: >vim
@@ -3204,7 +3204,7 @@ function vim.fn.getcursorcharpos(winid) end
--- getcwd(0)
--- getcwd(0, 0)
--- <If {winnr} is -1 it is ignored, only the tab is resolved.
--- {winnr} can be the window number or the |window-ID|.
--- {winnr} is a |window-number| or |window-ID|.
--- If both {winnr} and {tabnr} are -1 the global working
--- directory is returned.
--- Note: When {tabnr} is -1 Vim returns an empty string to
@@ -3310,8 +3310,8 @@ function vim.fn.getftype(fname) end
--- Returns the |jumplist| for the specified window.
---
--- Without arguments use the current window.
--- With {winnr} only use this window in the current tabpage.
--- {winnr} can also be a |window-ID|.
--- With {winnr} (|window-number| or |window-ID|) only use this
--- window in the current tabpage.
--- With {winnr} and {tabnr} use the window in the specified tab
--- page. If {winnr} or {tabnr} is invalid, an empty list is
--- returned.
@@ -3366,12 +3366,12 @@ function vim.fn.getline(lnum, end_) end
function vim.fn.getline(lnum, end_) end
--- Returns a |List| with all the entries in the location list for
--- window {nr}. {nr} can be the window number or the |window-ID|.
--- window {nr} (|window-number| or |window-ID|).
--- When {nr} is zero the current window is used.
---
--- For a location list window, the displayed location list is
--- returned. For an invalid window number {nr}, an empty list is
--- returned. Otherwise, same as |getqflist()|.
--- returned. For an invalid {nr}, an empty list is returned.
--- Otherwise, same as |getqflist()|.
---
--- If the optional {what} dictionary argument is supplied, then
--- returns the items listed in {what} as a dictionary. Refer to
@@ -3428,9 +3428,9 @@ function vim.fn.getmarklist(buf) end
--- |getmatches()| is useful in combination with |setmatches()|,
--- as |setmatches()| can restore a list of matches saved by
--- |getmatches()|.
--- If {win} is specified, use the window with this number or
--- window ID instead of the current window. If {win} is invalid,
--- an empty list is returned.
--- If {win} is specified, use this |window-number| or |window-ID|
--- instead of the current window. If {win} is invalid, an empty
--- list is returned.
--- Example: >vim
--- echo getmatches()
--- < >
@@ -3943,7 +3943,7 @@ function vim.fn.gettabvar(tabnr, varname, def) end
--- Note that {varname} must be the name without "w:".
--- Tabs are numbered starting with one. For the current tabpage
--- use |getwinvar()|.
--- {winnr} can be the window number or the |window-ID|.
--- {winnr} is a |window-number| or |window-ID|.
--- When {winnr} is zero the current window is used.
--- This also works for a global option, buffer-local option and
--- window-local option, but it doesn't work for a global variable
@@ -3965,8 +3965,8 @@ function vim.fn.gettabvar(tabnr, varname, def) end
--- @return any
function vim.fn.gettabwinvar(tabnr, winnr, varname, def) end
--- Returns the tag stack of window {winnr} as a Dict.
--- {winnr} can be the window number or the |window-ID|.
--- Returns the tag stack of window {winnr} (|window-number| or
--- |window-ID|) as a Dict.
--- When {winnr} is not specified, the current window is used.
--- When window {winnr} doesn't exist, an empty Dict is returned.
---
@@ -4042,7 +4042,7 @@ function vim.fn.gettext(text) end
--- wincol leftmost screen column of the window;
--- "col" from |win_screenpos()|
--- winid |window-ID|
--- winnr window number
--- winnr |window-number|
--- winrow topmost screen line of the window;
--- "row" from |win_screenpos()|
---
@@ -4300,7 +4300,7 @@ function vim.fn.has_key(dict, key) end
--- echo haslocaldir(0, 0)
--- <With {winnr} use that window in the current tabpage.
--- With {winnr} and {tabnr} use the window in that tabpage.
--- {winnr} can be the window number or the |window-ID|.
--- {winnr} is a |window-number| or |window-ID|.
--- If {winnr} is -1 it is ignored, only the tab is resolved.
--- Throw error if the arguments are invalid. |E5000| |E5001| |E5002|
---
@@ -5734,8 +5734,8 @@ function vim.fn.match(expr, pat, start, count) end
--- conceal Special character to show instead of the
--- match (only for |hl-Conceal| highlighted
--- matches, see |:syn-cchar|)
--- window Instead of the current window use the
--- window with this number or window ID.
--- window Use this |window-number| or |window-ID| instead
--- of the current window.
---
--- The number of matches is not limited, as it is the case with
--- the |:match| commands.
@@ -5874,8 +5874,7 @@ function vim.fn.matchbufline(buf, pat, lnum, end_, dict) end
--- or one of the |:match| commands. Returns 0 if successful,
--- otherwise -1. See example for |matchadd()|. All matches can
--- be deleted in one operation by |clearmatches()|.
--- If {win} is specified, use the window with this number or
--- window ID instead of the current window.
--- {win} (if given) is a |window-number| or |window-ID|.
---
--- @param id integer
--- @param win? integer
@@ -8299,12 +8298,12 @@ function vim.fn.setfperm(fname, mode) end
--- @return any
function vim.fn.setline(lnum, text) end
--- Create or replace or add to the location list for window {nr}.
--- {nr} can be the window number or the |window-ID|.
--- Create or replace or add to the location list for window {nr}
--- (|window-number| or |window-ID|).
--- When {nr} is zero the current window is used.
---
--- For a location list window, the displayed location list is
--- modified. For an invalid window number {nr}, -1 is returned.
--- modified. For an invalid {nr}, -1 is returned.
--- Otherwise, same as |setqflist()|.
--- Also see |location-list|.
---
@@ -8325,8 +8324,7 @@ function vim.fn.setloclist(nr, list, action, what) end
--- current window. Returns 0 if successful, otherwise -1. All
--- current matches are cleared before the list is restored. See
--- example for |getmatches()|.
--- If {win} is specified, use the window with this number or
--- window ID instead of the current window.
--- {win} (if given) is a |window-number| or |window-ID|.
---
--- @param list vim.fn.getmatches.ret.item[]
--- @param win? integer
@@ -8591,7 +8589,7 @@ function vim.fn.settabvar(tabnr, varname, val) end
--- {val}.
--- Tabs are numbered starting with one. For the current tabpage
--- use |setwinvar()|.
--- {winnr} can be the window number or the |window-ID|.
--- {winnr} is a |window-number| or |window-ID|.
--- When {winnr} is zero the current window is used.
--- This also works for a global or local buffer option, but it
--- doesn't work for a global or local buffer variable.
@@ -8609,8 +8607,8 @@ function vim.fn.settabvar(tabnr, varname, val) end
--- @return any
function vim.fn.settabwinvar(tabnr, winnr, varname, val) end
--- Modify the tag stack of the window {nr} using {dict}.
--- {nr} can be the window number or the |window-ID|.
--- Modify the tag stack of the window {nr} (|window-number| or
--- |window-ID|) using {dict}.
---
--- For a list of supported items in {dict}, refer to
--- |gettagstack()|. "curidx" takes effect before changing the tag
@@ -10795,8 +10793,8 @@ function vim.fn.virtcol(expr, list, winid) end
--- For a multi-byte character, the column number of the first
--- byte in the character is returned.
---
--- The {winid} argument can be the window number or the
--- |window-ID|. If this is zero, then the current window is used.
--- {winid} is a |window-number| or |window-ID|. If zero, the
--- current window is used.
---
--- Returns -1 if the window {winid} doesn't exist or the buffer
--- line {lnum} or virtual column {col} is invalid.
@@ -10915,10 +10913,9 @@ function vim.fn.win_findbuf(bufnr) end
--- Get the |window-ID| for the specified window.
--- When {win} is missing use the current window.
--- With {win} this is the window number. The top window has
--- number 1.
--- Without {tab} use the current tab, otherwise the tab with
--- number {tab}. The first tab has number one.
--- With {win} this is the |window-number|.
--- Without {tab} use the current tab, otherwise the
--- |tabpage-number| given by {tab}.
--- Return zero if the window cannot be found.
---
--- @param win? integer
@@ -10938,8 +10935,8 @@ function vim.fn.win_getid(win, tab) end
--- "unknown" window {nr} not found
---
--- When {nr} is omitted return the type of the current window.
--- When {nr} is given return the type of this window by number or
--- |window-ID|.
--- When {nr} is given (|window-number| or |window-ID|) return the
--- type of that window.
---
--- Also see the 'buftype' option.
---
@@ -10947,8 +10944,7 @@ function vim.fn.win_getid(win, tab) end
--- @return 'autocmd'|'command'|''|'loclist'|'popup'|'preview'|'quickfix'|'unknown'
function vim.fn.win_gettype(nr) end
--- Go to window with ID {expr}. This may also change the current
--- tabpage.
--- Go to |window-ID| {expr}. May change the current tabpage.
--- Return TRUE if successful, FALSE if the window cannot be
--- found.
---
@@ -10956,15 +10952,15 @@ function vim.fn.win_gettype(nr) end
--- @return 0|1
function vim.fn.win_gotoid(expr) end
--- Return a list with the tab number and window number of window
--- with ID {expr}: [tabnr, winnr].
--- Return [tabnr, winnr] for window with |window-ID| {expr}, where
--- tabnr is the |tabpage-number| and winnr is the |window-number|.
--- Return [0, 0] if the window cannot be found.
---
--- @param expr integer
--- @return any
function vim.fn.win_id2tabwin(expr) end
--- Return the window number of window with ID {expr}.
--- Return the |window-number| of for the given |window-ID| {expr}.
--- Return 0 if the window cannot be found in the current tabpage.
---
--- @param expr integer
@@ -10973,7 +10969,7 @@ function vim.fn.win_id2win(expr) end
--- Move window {nr}'s vertical separator (i.e., the right border)
--- by {offset} columns, as if being dragged by the mouse. {nr}
--- can be a window number or |window-ID|. A positive {offset}
--- is a |window-number| or |window-ID|. A positive {offset}
--- moves right and a negative {offset} moves left. Moving a
--- window's vertical separator will change the width of the
--- window and the width of other windows adjacent to the vertical
@@ -10991,8 +10987,8 @@ function vim.fn.win_id2win(expr) end
function vim.fn.win_move_separator(nr, offset) end
--- Move window {nr}'s status line (i.e., the bottom border) by
--- {offset} rows, as if being dragged by the mouse. {nr} can be
--- a window number or |window-ID|. A positive {offset} moves
--- {offset} rows, as if being dragged by the mouse. {nr} is a
--- |window-number| or |window-ID|. A positive {offset} moves
--- down and a negative {offset} moves up. Moving a window's
--- status line will change the height of the window and the
--- height of other windows adjacent to the status line. The
@@ -11009,8 +11005,8 @@ function vim.fn.win_move_statusline(nr, offset) end
--- Return the screen position of window {nr} as a list with two
--- numbers: [row, col]. The first window always has position
--- [1, 1], unless there is a tabline, then it is [2, 1].
--- {nr} can be the window number or the |window-ID|. Use zero
--- for the current window.
--- {nr} is a |window-number| or |window-ID|. Use zero for the
--- current window.
--- Returns [0, 0] if the window cannot be found.
---
--- @param nr integer
@@ -11022,7 +11018,7 @@ function vim.fn.win_screenpos(nr) end
--- Unlike commands such as |:split|, no new windows are created
--- (the |window-ID| of window {nr} is unchanged after the move).
---
--- Both {nr} and {target} can be window numbers or |window-ID|s.
--- Both {nr} and {target} are a |window-number| or |window-ID|.
--- Both must be in the current tabpage.
---
--- Returns zero for success, non-zero for failure.
@@ -11042,8 +11038,8 @@ function vim.fn.win_screenpos(nr) end
--- @return any
function vim.fn.win_splitmove(nr, target, options) end
--- Returns the buffer number associated with window {nr}.
--- {nr} can be the window number or the |window-ID|.
--- Returns the buffer number associated with window {nr}
--- (|window-number| or |window-ID|).
--- When {nr} is zero, the number of the buffer in the current
--- window is returned.
--- When window {nr} doesn't exist, -1 is returned.

View File

@@ -195,8 +195,8 @@ M.funcs = {
If {winid} is not supplied, the argument list of the current
window is used.
If {winid} is -1, the global argument list is used.
Otherwise {winid} specifies the window of which the argument
list is used: either the window number or the window ID.
Otherwise {winid} (a |window-number| or |window-ID|) specifies
the window of which the argument list is used.
Returns -1 if the {winid} argument is invalid.
]=],
name = 'argc',
@@ -226,7 +226,7 @@ M.funcs = {
With {winnr} only use this window in the current tabpage.
With {winnr} and {tabnr} use the window in the specified tab
page.
{winnr} can be the window number or the |window-ID|.
{winnr} is a |window-number| or |window-ID|.
]=],
name = 'arglistid',
params = { { 'winnr', 'integer' }, { 'tabnr', 'integer' } },
@@ -247,7 +247,7 @@ M.funcs = {
<Without the {nr} argument, or when {nr} is -1, a |List| with
the whole |arglist| is returned.
The {winid} argument specifies the window ID, see |argc()|.
The {winid} argument is a |window-ID|, see |argc()|.
For the Vim command line arguments see |v:argv|.
Returns an empty string if {nr}th argument is not present in
@@ -884,7 +884,7 @@ M.funcs = {
args = 1,
base = 1,
desc = [=[
Like |bufwinid()| but return the window number instead of the
Like |bufwinid()| but returns a |window-number| instead of a
|window-ID|.
If buffer {buf} doesn't exist or there is no such window, -1
is returned. Example: >vim
@@ -1258,8 +1258,8 @@ M.funcs = {
desc = [=[
Clears all matches previously defined for the current window
by |matchadd()| and the |:match| commands.
If {win} is specified, use the window with this number or
window ID instead of the current window.
If {win} is specified, use this |window-number| or |window-ID|
instead of the current window.
]=],
name = 'clearmatches',
@@ -3953,10 +3953,10 @@ M.funcs = {
the cursor is returned in "col". To get the character
position, use |getcursorcharpos()|.
The optional {winid} argument can specify the window. It can
be the window number or the |window-ID|. The last known
cursor position is returned, this may be invalid for the
current value of the buffer if it is not the current window.
The optional {winid} (|window-number| or |window-ID|) specifies
the window. The last known cursor position is returned, this
may be invalid for the current value of the buffer if it is not
the current window.
If {winid} is invalid a list with zeroes is returned.
This can be used to save and restore the cursor position: >vim
@@ -4002,7 +4002,7 @@ M.funcs = {
getcwd(0)
getcwd(0, 0)
<If {winnr} is -1 it is ignored, only the tab is resolved.
{winnr} can be the window number or the |window-ID|.
{winnr} is a |window-number| or |window-ID|.
If both {winnr} and {tabnr} are -1 the global working
directory is returned.
Note: When {tabnr} is -1 Vim returns an empty string to
@@ -4150,8 +4150,8 @@ M.funcs = {
Returns the |jumplist| for the specified window.
Without arguments use the current window.
With {winnr} only use this window in the current tabpage.
{winnr} can also be a |window-ID|.
With {winnr} (|window-number| or |window-ID|) only use this
window in the current tabpage.
With {winnr} and {tabnr} use the window in the specified tab
page. If {winnr} or {tabnr} is invalid, an empty list is
returned.
@@ -4216,12 +4216,12 @@ M.funcs = {
args = { 1, 2 },
desc = [=[
Returns a |List| with all the entries in the location list for
window {nr}. {nr} can be the window number or the |window-ID|.
window {nr} (|window-number| or |window-ID|).
When {nr} is zero the current window is used.
For a location list window, the displayed location list is
returned. For an invalid window number {nr}, an empty list is
returned. Otherwise, same as |getqflist()|.
returned. For an invalid {nr}, an empty list is returned.
Otherwise, same as |getqflist()|.
If the optional {what} dictionary argument is supplied, then
returns the items listed in {what} as a dictionary. Refer to
@@ -4286,9 +4286,9 @@ M.funcs = {
|getmatches()| is useful in combination with |setmatches()|,
as |setmatches()| can restore a list of matches saved by
|getmatches()|.
If {win} is specified, use the window with this number or
window ID instead of the current window. If {win} is invalid,
an empty list is returned.
If {win} is specified, use this |window-number| or |window-ID|
instead of the current window. If {win} is invalid, an empty
list is returned.
Example: >vim
echo getmatches()
< >
@@ -4872,7 +4872,7 @@ M.funcs = {
Note that {varname} must be the name without "w:".
Tabs are numbered starting with one. For the current tabpage
use |getwinvar()|.
{winnr} can be the window number or the |window-ID|.
{winnr} is a |window-number| or |window-ID|.
When {winnr} is zero the current window is used.
This also works for a global option, buffer-local option and
window-local option, but it doesn't work for a global variable
@@ -4900,8 +4900,8 @@ M.funcs = {
args = { 0, 1 },
base = 1,
desc = [=[
Returns the tag stack of window {winnr} as a Dict.
{winnr} can be the window number or the |window-ID|.
Returns the tag stack of window {winnr} (|window-number| or
|window-ID|) as a Dict.
When {winnr} is not specified, the current window is used.
When window {winnr} doesn't exist, an empty Dict is returned.
@@ -4987,7 +4987,7 @@ M.funcs = {
wincol leftmost screen column of the window;
"col" from |win_screenpos()|
winid |window-ID|
winnr window number
winnr |window-number|
winrow topmost screen line of the window;
"row" from |win_screenpos()|
@@ -5295,7 +5295,7 @@ M.funcs = {
echo haslocaldir(0, 0)
<With {winnr} use that window in the current tabpage.
With {winnr} and {tabnr} use the window in that tabpage.
{winnr} can be the window number or the |window-ID|.
{winnr} is a |window-number| or |window-ID|.
If {winnr} is -1 it is ignored, only the tab is resolved.
Throw error if the arguments are invalid. |E5000| |E5001| |E5002|
@@ -7043,8 +7043,8 @@ M.funcs = {
conceal Special character to show instead of the
match (only for |hl-Conceal| highlighted
matches, see |:syn-cchar|)
window Instead of the current window use the
window with this number or window ID.
window Use this |window-number| or |window-ID| instead
of the current window.
The number of matches is not limited, as it is the case with
the |:match| commands.
@@ -7213,8 +7213,7 @@ M.funcs = {
or one of the |:match| commands. Returns 0 if successful,
otherwise -1. See example for |matchadd()|. All matches can
be deleted in one operation by |clearmatches()|.
If {win} is specified, use the window with this number or
window ID instead of the current window.
{win} (if given) is a |window-number| or |window-ID|.
]=],
name = 'matchdelete',
@@ -10067,12 +10066,12 @@ M.funcs = {
args = { 2, 4 },
base = 2,
desc = [=[
Create or replace or add to the location list for window {nr}.
{nr} can be the window number or the |window-ID|.
Create or replace or add to the location list for window {nr}
(|window-number| or |window-ID|).
When {nr} is zero the current window is used.
For a location list window, the displayed location list is
modified. For an invalid window number {nr}, -1 is returned.
modified. For an invalid {nr}, -1 is returned.
Otherwise, same as |setqflist()|.
Also see |location-list|.
@@ -10100,8 +10099,7 @@ M.funcs = {
current window. Returns 0 if successful, otherwise -1. All
current matches are cleared before the list is restored. See
example for |getmatches()|.
If {win} is specified, use the window with this number or
window ID instead of the current window.
{win} (if given) is a |window-number| or |window-ID|.
]=],
name = 'setmatches',
@@ -10387,7 +10385,7 @@ M.funcs = {
{val}.
Tabs are numbered starting with one. For the current tabpage
use |setwinvar()|.
{winnr} can be the window number or the |window-ID|.
{winnr} is a |window-number| or |window-ID|.
When {winnr} is zero the current window is used.
This also works for a global or local buffer option, but it
doesn't work for a global or local buffer variable.
@@ -10412,8 +10410,8 @@ M.funcs = {
args = { 2, 3 },
base = 2,
desc = [=[
Modify the tag stack of the window {nr} using {dict}.
{nr} can be the window number or the |window-ID|.
Modify the tag stack of the window {nr} (|window-number| or
|window-ID|) using {dict}.
For a list of supported items in {dict}, refer to
|gettagstack()|. "curidx" takes effect before changing the tag
@@ -13063,8 +13061,8 @@ M.funcs = {
For a multi-byte character, the column number of the first
byte in the character is returned.
The {winid} argument can be the window number or the
|window-ID|. If this is zero, then the current window is used.
{winid} is a |window-number| or |window-ID|. If zero, the
current window is used.
Returns -1 if the window {winid} doesn't exist or the buffer
line {lnum} or virtual column {col} is invalid.
@@ -13208,10 +13206,9 @@ M.funcs = {
desc = [=[
Get the |window-ID| for the specified window.
When {win} is missing use the current window.
With {win} this is the window number. The top window has
number 1.
Without {tab} use the current tab, otherwise the tab with
number {tab}. The first tab has number one.
With {win} this is the |window-number|.
Without {tab} use the current tab, otherwise the
|tabpage-number| given by {tab}.
Return zero if the window cannot be found.
]=],
@@ -13236,8 +13233,8 @@ M.funcs = {
"unknown" window {nr} not found
When {nr} is omitted return the type of the current window.
When {nr} is given return the type of this window by number or
|window-ID|.
When {nr} is given (|window-number| or |window-ID|) return the
type of that window.
Also see the 'buftype' option.
@@ -13251,8 +13248,7 @@ M.funcs = {
args = 1,
base = 1,
desc = [=[
Go to window with ID {expr}. This may also change the current
tabpage.
Go to |window-ID| {expr}. May change the current tabpage.
Return TRUE if successful, FALSE if the window cannot be
found.
@@ -13266,8 +13262,8 @@ M.funcs = {
args = 1,
base = 1,
desc = [=[
Return a list with the tab number and window number of window
with ID {expr}: [tabnr, winnr].
Return [tabnr, winnr] for window with |window-ID| {expr}, where
tabnr is the |tabpage-number| and winnr is the |window-number|.
Return [0, 0] if the window cannot be found.
]=],
@@ -13279,7 +13275,7 @@ M.funcs = {
args = 1,
base = 1,
desc = [=[
Return the window number of window with ID {expr}.
Return the |window-number| of for the given |window-ID| {expr}.
Return 0 if the window cannot be found in the current tabpage.
]=],
@@ -13294,7 +13290,7 @@ M.funcs = {
desc = [=[
Move window {nr}'s vertical separator (i.e., the right border)
by {offset} columns, as if being dragged by the mouse. {nr}
can be a window number or |window-ID|. A positive {offset}
is a |window-number| or |window-ID|. A positive {offset}
moves right and a negative {offset} moves left. Moving a
window's vertical separator will change the width of the
window and the width of other windows adjacent to the vertical
@@ -13316,8 +13312,8 @@ M.funcs = {
base = 1,
desc = [=[
Move window {nr}'s status line (i.e., the bottom border) by
{offset} rows, as if being dragged by the mouse. {nr} can be
a window number or |window-ID|. A positive {offset} moves
{offset} rows, as if being dragged by the mouse. {nr} is a
|window-number| or |window-ID|. A positive {offset} moves
down and a negative {offset} moves up. Moving a window's
status line will change the height of the window and the
height of other windows adjacent to the status line. The
@@ -13338,8 +13334,8 @@ M.funcs = {
Return the screen position of window {nr} as a list with two
numbers: [row, col]. The first window always has position
[1, 1], unless there is a tabline, then it is [2, 1].
{nr} can be the window number or the |window-ID|. Use zero
for the current window.
{nr} is a |window-number| or |window-ID|. Use zero for the
current window.
Returns [0, 0] if the window cannot be found.
]=],
name = 'win_screenpos',
@@ -13355,7 +13351,7 @@ M.funcs = {
Unlike commands such as |:split|, no new windows are created
(the |window-ID| of window {nr} is unchanged after the move).
Both {nr} and {target} can be window numbers or |window-ID|s.
Both {nr} and {target} are a |window-number| or |window-ID|.
Both must be in the current tabpage.
Returns zero for success, non-zero for failure.
@@ -13378,8 +13374,8 @@ M.funcs = {
args = 1,
base = 1,
desc = [=[
Returns the buffer number associated with window {nr}.
{nr} can be the window number or the |window-ID|.
Returns the buffer number associated with window {nr}
(|window-number| or |window-ID|).
When {nr} is zero, the number of the buffer in the current
window is returned.
When window {nr} doesn't exist, -1 is returned.

View File

@@ -8872,7 +8872,7 @@ local options = {
added without modifying code that reacts on mouse clicks on
this label.
Use |getmousepos()|.winid in the specified function to get the
corresponding window id of the clicked item.
corresponding |window-ID| of the clicked item.
\< - Where to truncate line if too long. Default is at the start.
No width fields allowed.
= - Separation point between alignment sections. Each section will
@@ -9742,17 +9742,26 @@ local options = {
abbreviation = 'tf',
defaults = true,
desc = [=[
Assume that the underlying terminal can respond quickly to queries
required by features such as 'background' detection.
Nvim issues terminal queries before reading the user's |config| file,
so disabling this option there will not work. Set $NVIM_NOTTYFAST
before starting Nvim to disable terminal queries.
Enables Nvim |TUI| features which assume a fast (usually local) host
terminal. During startup, Nvim queries the terminal (for 'background'
detection, etc.) and must wait for a response (or timeout).
If your terminal environment is slow (e.g. remote SSH), or broken
(doesn't respond to queries), Nvim startup may be slower. Therefore
you can disable this option by setting the `$NVIM_NOTTYFAST`
environment variable before starting Nvim: >
NVIM_NOTTYFAST=1 nvim
<
The queries are performed early, before |--cmd| and user |config|, so
`:set nottyfast` in your config happens too late.
]=],
full_name = 'ttyfast',
no_mkrc = true,
scope = { 'global' },
short_desc = N_('assume terminal responds quickly, enabling more features'),
-- Vim E1568: https://github.com/vim/vim/blob/0f9218851dc91a855c3d186ccd05f550907cf37e/src/errors.h#L3791
tags = { 'E1568', '$NVIM_NOTTYFAST' },
type = 'boolean',
varname = 'p_tf',
},

View File

@@ -30,6 +30,11 @@ local is_os = t.is_os
local testlog = 'Xtest-defaults-log'
describe('startup defaults', function()
it("NVIM_NOTTYFAST=1 unsets 'ttyfast'", function()
clear { env = { NVIM_NOTTYFAST = '1' } }
eq(0, n.eval('&ttyfast'))
end)
describe(':filetype', function()
local function expect_filetype(expected)
local screen = Screen.new(50, 4)

View File

@@ -3326,7 +3326,7 @@ describe('TUI', function()
end)
local child_session = n.connect(child_server)
local expected_msg =
"defaults.lua: Did not detect DSR response from terminal for 'background' detection. This results in a slower startup time. To disable this and other 'ttyfast' features during startup, set the environment variable NVIM_NOTTYFAST"
"E1568: Terminal did not respond to DSR request for 'background' color. Startup may be slower. :help 'ttyfast'"
retry(nil, 4000, function()
eq({ true, { mode = 'n', blocking = false } }, { child_session:request('nvim_get_mode') })
if not is_os('win') then -- ConPTY provides DSR response on Windows?