mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
docs: fix typos (#19024)
Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Valery Viktorovsky <viktorovsky@gmail.com>
This commit is contained in:
parent
c1652bdcb5
commit
abc087f4c6
@ -1968,7 +1968,7 @@ nvim_buf_get_option({buffer}, {name}) *nvim_buf_get_option()*
|
||||
Option value
|
||||
|
||||
nvim_buf_set_option({buffer}, {name}, {value}) *nvim_buf_set_option()*
|
||||
Sets a buffer option value. Passing 'nil' as value deletes the
|
||||
Sets a buffer option value. Passing `nil` as value deletes the
|
||||
option (only works if there's a global fallback)
|
||||
|
||||
Parameters: ~
|
||||
@ -2075,8 +2075,8 @@ nvim_win_get_option({window}, {name}) *nvim_win_get_option()*
|
||||
Option value
|
||||
|
||||
nvim_win_set_option({window}, {name}, {value}) *nvim_win_set_option()*
|
||||
Sets a window option value. Passing 'nil' as value deletes the
|
||||
option(only works if there's a global fallback)
|
||||
Sets a window option value. Passing `nil` as value deletes the
|
||||
option (only works if there's a global fallback)
|
||||
|
||||
Parameters: ~
|
||||
{window} Window handle, or 0 for current window
|
||||
|
@ -6674,7 +6674,6 @@ setbufline({buf}, {lnum}, {text}) *setbufline()*
|
||||
|bufload()| if needed.
|
||||
|
||||
To insert lines use |appendbufline()|.
|
||||
Any text properties in {lnum} are cleared.
|
||||
|
||||
{text} can be a string to set one line, or a list of strings
|
||||
to set multiple lines. If the list extends below the last
|
||||
@ -8012,10 +8011,10 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()*
|
||||
The result is a String, which is the {what} attribute of
|
||||
syntax ID {synID}. This can be used to obtain information
|
||||
about a syntax item.
|
||||
{mode} can be "gui", "cterm" or "term", to get the attributes
|
||||
{mode} can be "gui" or "cterm", to get the attributes
|
||||
for that mode. When {mode} is omitted, or an invalid value is
|
||||
used, the attributes for the currently active highlighting are
|
||||
used (GUI, cterm or term).
|
||||
used (GUI or cterm).
|
||||
Use synIDtrans() to follow linked highlight groups.
|
||||
{what} result
|
||||
"name" the name of the syntax item
|
||||
@ -8040,15 +8039,15 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()*
|
||||
"underdouble" "1" if double underlined
|
||||
"underdotted" "1" if dotted underlined
|
||||
"underdashed" "1" if dashed underlined
|
||||
"strikethrough" "1" if struckthrough
|
||||
"strikethrough" "1" if struckthrough
|
||||
"nocombine" "1" if nocombine
|
||||
|
||||
Returns an empty string on error.
|
||||
|
||||
Example (echoes the color of the syntax item under the
|
||||
cursor): >
|
||||
:echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg")
|
||||
<
|
||||
Returns an empty string on error.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
:echo synID(line("."), col("."), 1)->synIDtrans()->synIDattr("fg")
|
||||
|
||||
|
@ -74,7 +74,7 @@ Functions that take a severity as an optional parameter (e.g.
|
||||
|
||||
2. A table with a "min" or "max" key (or both): >
|
||||
|
||||
vim.diagnostic.get(0, { severity = {min=vim.diagnostic.severity.WARN} })
|
||||
vim.diagnostic.get(0, { severity = { min = vim.diagnostic.severity.WARN } })
|
||||
|
||||
The latter form allows users to specify a range of severities.
|
||||
|
||||
@ -298,7 +298,7 @@ EVENTS *diagnostic-events*
|
||||
DiagnosticChanged After diagnostics have changed.
|
||||
|
||||
Example: >
|
||||
autocmd DiagnosticChanged * lua vim.diagnostic.setqflist({open = false })
|
||||
autocmd DiagnosticChanged * lua vim.diagnostic.setqflist({ open = false })
|
||||
<
|
||||
==============================================================================
|
||||
Lua module: vim.diagnostic *diagnostic-api*
|
||||
@ -315,12 +315,12 @@ config({opts}, {namespace}) *vim.diagnostic.config()*
|
||||
|
||||
For example, if a user enables virtual text globally with >
|
||||
|
||||
vim.diagnostic.config({virtual_text = true})
|
||||
vim.diagnostic.config({ virtual_text = true })
|
||||
<
|
||||
|
||||
and a diagnostic producer sets diagnostics with >
|
||||
|
||||
vim.diagnostic.set(ns, 0, diagnostics, {virtual_text = false})
|
||||
vim.diagnostic.set(ns, 0, diagnostics, { virtual_text = false })
|
||||
<
|
||||
|
||||
then virtual text will not be enabled for those diagnostics.
|
||||
@ -570,8 +570,8 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults})
|
||||
|
||||
local s = "WARNING filename:27:3: Variable 'foo' does not exist"
|
||||
local pattern = "^(%w+) %w+:(%d+):(%d+): (.+)$"
|
||||
local groups = {"severity", "lnum", "col", "message"}
|
||||
vim.diagnostic.match(s, pattern, groups, {WARNING = vim.diagnostic.WARN})
|
||||
local groups = { "severity", "lnum", "col", "message" }
|
||||
vim.diagnostic.match(s, pattern, groups, { WARNING = vim.diagnostic.WARN })
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
|
@ -3571,7 +3571,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
help. (Note that previously setting the global option to the empty
|
||||
value did this, which is now deprecated.)
|
||||
When the first character is ":", the command is invoked as a Vim
|
||||
Ex command with [count] added as an argument if it is not zero.
|
||||
Ex command prefixed with [count].
|
||||
When "man" or "man -s" is used, Vim will automatically translate
|
||||
a [count] for the "K" command to a section number.
|
||||
See |option-backslash| about including spaces and backslashes.
|
||||
@ -4210,14 +4210,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
The 'mousemodel' option is set by the |:behave| command.
|
||||
|
||||
*mousescroll*
|
||||
*'mousescroll'*
|
||||
'mousescroll' string (default "ver:3,hor:6")
|
||||
global
|
||||
This option controls the number of lines / columns to scroll by when
|
||||
scrolling with a mouse. The option is a comma separated list of parts.
|
||||
Each part consists of a direction and a count as follows:
|
||||
direction:count,direction:count
|
||||
Direction is one of either "hor" or "ver", "hor" controls horizontal
|
||||
Direction is one of either "hor" or "ver". "hor" controls horizontal
|
||||
scrolling and "ver" controls vertical scrolling. Count sets the amount
|
||||
to scroll by for the given direction, it should be a non negative
|
||||
integer. Each direction should be set at most once. If a direction
|
||||
|
@ -135,7 +135,6 @@ You could also write your own color scheme. This is how you do it:
|
||||
|
||||
2. Edit the color scheme file. These entries are useful:
|
||||
|
||||
term attributes in a B&W terminal
|
||||
cterm attributes in a color terminal
|
||||
ctermfg foreground color in a color terminal
|
||||
ctermbg background color in a color terminal
|
||||
|
@ -586,12 +586,12 @@ end
|
||||
---
|
||||
--- For example, if a user enables virtual text globally with
|
||||
--- <pre>
|
||||
--- vim.diagnostic.config({virtual_text = true})
|
||||
--- vim.diagnostic.config({ virtual_text = true })
|
||||
--- </pre>
|
||||
---
|
||||
--- and a diagnostic producer sets diagnostics with
|
||||
--- <pre>
|
||||
--- vim.diagnostic.set(ns, 0, diagnostics, {virtual_text = false})
|
||||
--- vim.diagnostic.set(ns, 0, diagnostics, { virtual_text = false })
|
||||
--- </pre>
|
||||
---
|
||||
--- then virtual text will not be enabled for those diagnostics.
|
||||
@ -1525,8 +1525,8 @@ end
|
||||
--- <pre>
|
||||
--- local s = "WARNING filename:27:3: Variable 'foo' does not exist"
|
||||
--- local pattern = "^(%w+) %w+:(%d+):(%d+): (.+)$"
|
||||
--- local groups = {"severity", "lnum", "col", "message"}
|
||||
--- vim.diagnostic.match(s, pattern, groups, {WARNING = vim.diagnostic.WARN})
|
||||
--- local groups = { "severity", "lnum", "col", "message" }
|
||||
--- vim.diagnostic.match(s, pattern, groups, { WARNING = vim.diagnostic.WARN })
|
||||
--- </pre>
|
||||
---
|
||||
---@param str string String to parse diagnostics from.
|
||||
|
@ -280,7 +280,7 @@ Object nvim_buf_get_option(Buffer buffer, String name, Error *err)
|
||||
return get_option_from(buf, SREQ_BUF, name, err);
|
||||
}
|
||||
|
||||
/// Sets a buffer option value. Passing 'nil' as value deletes the option (only
|
||||
/// Sets a buffer option value. Passing `nil` as value deletes the option (only
|
||||
/// works if there's a global fallback)
|
||||
///
|
||||
/// @param channel_id
|
||||
@ -318,7 +318,7 @@ Object nvim_win_get_option(Window window, String name, Error *err)
|
||||
return get_option_from(win, SREQ_WIN, name, err);
|
||||
}
|
||||
|
||||
/// Sets a window option value. Passing 'nil' as value deletes the option(only
|
||||
/// Sets a window option value. Passing `nil` as value deletes the option (only
|
||||
/// works if there's a global fallback)
|
||||
///
|
||||
/// @param channel_id
|
||||
@ -338,7 +338,7 @@ void nvim_win_set_option(uint64_t channel_id, Window window, String name, Object
|
||||
set_option_to(channel_id, win, SREQ_WIN, name, value, err);
|
||||
}
|
||||
|
||||
/// Gets the value of a global or local(buffer, window) option.
|
||||
/// Gets the value of a global or local (buffer, window) option.
|
||||
///
|
||||
/// @param from If `type` is `SREQ_WIN` or `SREQ_BUF`, this must be a pointer
|
||||
/// to the window or buffer.
|
||||
@ -393,7 +393,7 @@ Object get_option_from(void *from, int type, String name, Error *err)
|
||||
return rv;
|
||||
}
|
||||
|
||||
/// Sets the value of a global or local(buffer, window) option.
|
||||
/// Sets the value of a global or local (buffer, window) option.
|
||||
///
|
||||
/// @param to If `type` is `SREQ_WIN` or `SREQ_BUF`, this must be a pointer
|
||||
/// to the window or buffer.
|
||||
|
@ -5270,7 +5270,6 @@ void forward_slash(char_u *fname)
|
||||
return;
|
||||
}
|
||||
for (p = fname; *p != NUL; p++) {
|
||||
// The Big5 encoding can have '\' in the trail byte.
|
||||
if (*p == '\\') {
|
||||
*p = '/';
|
||||
}
|
||||
|
@ -1686,7 +1686,7 @@ int nlua_expand_pat(expand_T *xp, char_u *pat, int *num_results, char_u ***resul
|
||||
lua_getfield(lstate, -1, "_expand_pat");
|
||||
luaL_checktype(lstate, -1, LUA_TFUNCTION);
|
||||
|
||||
// [ vim, vim._on_key, buf ]
|
||||
// [ vim, vim._expand_pat, buf ]
|
||||
lua_pushlstring(lstate, (const char *)pat, STRLEN(pat));
|
||||
|
||||
if (nlua_pcall(lstate, 1, 2) != 0) {
|
||||
@ -1839,7 +1839,7 @@ void nlua_execute_on_key(int c)
|
||||
// [ vim ]
|
||||
lua_getglobal(lstate, "vim");
|
||||
|
||||
// [ vim, vim._on_key]
|
||||
// [ vim, vim._on_key ]
|
||||
lua_getfield(lstate, -1, "_on_key");
|
||||
luaL_checktype(lstate, -1, LUA_TFUNCTION);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user