aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2022-07-31 10:46:38 +0200
committerGitHub <noreply@github.com>2022-07-31 16:46:38 +0800
commitabc087f4c65ca547cae58518b42aee82ff4a07f6 (patch)
treec988358f1a3e0811053ece2a805f4e1d58c1e00f
parentc1652bdcb5b5ca95b5ae328cec582f23816b70dd (diff)
downloadrneovim-abc087f4c65ca547cae58518b42aee82ff4a07f6.tar.gz
rneovim-abc087f4c65ca547cae58518b42aee82ff4a07f6.tar.bz2
rneovim-abc087f4c65ca547cae58518b42aee82ff4a07f6.zip
docs: fix typos (#19024)
Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Valery Viktorovsky <viktorovsky@gmail.com>
-rw-r--r--runtime/doc/api.txt6
-rw-r--r--runtime/doc/builtin.txt11
-rw-r--r--runtime/doc/diagnostic.txt12
-rw-r--r--runtime/doc/options.txt6
-rw-r--r--runtime/doc/usr_06.txt1
-rw-r--r--runtime/lua/vim/diagnostic.lua8
-rw-r--r--src/nvim/api/options.c8
-rw-r--r--src/nvim/fileio.c1
-rw-r--r--src/nvim/lua/executor.c4
9 files changed, 27 insertions, 30 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 9758959f4e..1426404da9 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -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
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index f973277b54..f844ae5aaf 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -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")
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index 2446506dec..7fb10f2a66 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -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: ~
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 68723e4889..f29828921d 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -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
diff --git a/runtime/doc/usr_06.txt b/runtime/doc/usr_06.txt
index b99e0fb482..8eda33b4f0 100644
--- a/runtime/doc/usr_06.txt
+++ b/runtime/doc/usr_06.txt
@@ -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
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua
index ae20b5c517..3f71d4f70d 100644
--- a/runtime/lua/vim/diagnostic.lua
+++ b/runtime/lua/vim/diagnostic.lua
@@ -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.
diff --git a/src/nvim/api/options.c b/src/nvim/api/options.c
index 5c9eba163b..867584dd71 100644
--- a/src/nvim/api/options.c
+++ b/src/nvim/api/options.c
@@ -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.
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 0fce7fe2c8..5b8dd35c43 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -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 = '/';
}
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index 824b9a8ec0..81314f8b4a 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -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);