mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
chore: fix typos (#17331)
Co-authored-by: Hongyi Lyu <hongyi.lyu95@gmail.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: notomo <notomo.motono@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
@@ -1079,7 +1079,7 @@ WinLeave Before leaving a window. If the window to be
|
|||||||
executes the BufLeave autocommands before the
|
executes the BufLeave autocommands before the
|
||||||
WinLeave autocommands (but not for ":new").
|
WinLeave autocommands (but not for ":new").
|
||||||
Not used for ":qa" or ":q" when exiting Vim.
|
Not used for ":qa" or ":q" when exiting Vim.
|
||||||
After WinClosed.
|
Before WinClosed.
|
||||||
*WinNew*
|
*WinNew*
|
||||||
WinNew When a new window was created. Not done for
|
WinNew When a new window was created. Not done for
|
||||||
the first window, when Vim has just started.
|
the first window, when Vim has just started.
|
||||||
|
@@ -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): >
|
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.
|
The latter form allows users to specify a range of severities.
|
||||||
|
|
||||||
|
@@ -355,8 +355,8 @@ To configure the behavior of a builtin |lsp-handler|, the convenient method
|
|||||||
*lsp-handler-resolution*
|
*lsp-handler-resolution*
|
||||||
Handlers can be set by:
|
Handlers can be set by:
|
||||||
|
|
||||||
- Setting a field in |vim.lsp.handlers|. *vim.lsp.handlers*
|
- Setting a field in vim.lsp.handlers. *vim.lsp.handlers*
|
||||||
|vim.lsp.handlers| is a global table that contains the default mapping of
|
vim.lsp.handlers is a global table that contains the default mapping of
|
||||||
|lsp-method| names to |lsp-handlers|.
|
|lsp-method| names to |lsp-handlers|.
|
||||||
|
|
||||||
To override the handler for the `"textDocument/definition"` method: >
|
To override the handler for the `"textDocument/definition"` method: >
|
||||||
|
@@ -1083,7 +1083,7 @@ from within Lua.
|
|||||||
`vim.opt.wildignore = '*.o,*.a,__pycache__'`
|
`vim.opt.wildignore = '*.o,*.a,__pycache__'`
|
||||||
|
|
||||||
However, vim.opt also supports a more elegent way of setting
|
However, vim.opt also supports a more elegent way of setting
|
||||||
list-style options, but using lua tables:
|
list-style options by using lua tables:
|
||||||
`vim.opt.wildignore = { '*.o', '*.a', '__pycache__' }`
|
`vim.opt.wildignore = { '*.o', '*.a', '__pycache__' }`
|
||||||
|
|
||||||
To replicate the behavior of |:set+=|, use: >
|
To replicate the behavior of |:set+=|, use: >
|
||||||
|
@@ -207,14 +207,14 @@ Here is a list of built-in predicates :
|
|||||||
|
|
||||||
`eq?` *ts-predicate-eq?*
|
`eq?` *ts-predicate-eq?*
|
||||||
This predicate will check text correspondence between nodes or
|
This predicate will check text correspondence between nodes or
|
||||||
strings : >
|
strings: >
|
||||||
((identifier) @foo (#eq? @foo "foo"))
|
((identifier) @foo (#eq? @foo "foo"))
|
||||||
((node1) @left (node2) @right (#eq? @left @right))
|
((node1) @left (node2) @right (#eq? @left @right))
|
||||||
<
|
<
|
||||||
`match?` *ts-predicate-match?*
|
`match?` *ts-predicate-match?*
|
||||||
`vim-match?` *ts-predicate-vim-match?*
|
`vim-match?` *ts-predicate-vim-match?*
|
||||||
This will match if the provided vim regex matches the text
|
This will match if the provided vim regex matches the text
|
||||||
corresponding to a node : >
|
corresponding to a node: >
|
||||||
((identifier) @constant (#match? @constant "^[A-Z_]+$"))
|
((identifier) @constant (#match? @constant "^[A-Z_]+$"))
|
||||||
< Note: the `^` and `$` anchors will respectively match the
|
< Note: the `^` and `$` anchors will respectively match the
|
||||||
start and end of the node's text.
|
start and end of the node's text.
|
||||||
@@ -225,17 +225,18 @@ Here is a list of built-in predicates :
|
|||||||
|
|
||||||
`contains?` *ts-predicate-contains?*
|
`contains?` *ts-predicate-contains?*
|
||||||
Will check if any of the following arguments appears in the
|
Will check if any of the following arguments appears in the
|
||||||
text corresponding to the node : >
|
text corresponding to the node: >
|
||||||
((identifier) @foo (#contains? @foo "foo"))
|
((identifier) @foo (#contains? @foo "foo"))
|
||||||
((identifier) @foo-bar (#contains @foo-bar "foo" "bar"))
|
((identifier) @foo-bar (#contains @foo-bar "foo" "bar"))
|
||||||
<
|
<
|
||||||
`any-of?` *ts-predicate-any-of?*
|
`any-of?` *ts-predicate-any-of?*
|
||||||
Will check if the text is the same as any of the following.
|
Will check if the text is the same as any of the following
|
||||||
|
arguments: >
|
||||||
|
((identifier) @foo (#any-of? @foo "foo" "bar"))
|
||||||
|
<
|
||||||
This is the recommended way to check if the node matches one
|
This is the recommended way to check if the node matches one
|
||||||
of many keywords for example, as it has been optimized for
|
of many keywords for example, as it has been optimized for
|
||||||
this.
|
this.
|
||||||
arguments : >
|
|
||||||
((identifier) @foo (#any-of? @foo "foo" "bar"))
|
|
||||||
<
|
<
|
||||||
*lua-treesitter-not-predicate*
|
*lua-treesitter-not-predicate*
|
||||||
Each predicate has a `not-` prefixed predicate that is just the negation of
|
Each predicate has a `not-` prefixed predicate that is just the negation of
|
||||||
|
@@ -25,7 +25,7 @@ local keymap = {}
|
|||||||
--- vim.keymap.set('n', 'asdf', require('jkl').my_fun)
|
--- vim.keymap.set('n', 'asdf', require('jkl').my_fun)
|
||||||
--- </pre>
|
--- </pre>
|
||||||
---
|
---
|
||||||
--- the require('jkl') gets evaluated during this call in order to access the function. If you want to
|
--- the `require('jkl')` gets evaluated during this call in order to access the function. If you want to
|
||||||
--- avoid this cost at startup you can wrap it in a function, for example:
|
--- avoid this cost at startup you can wrap it in a function, for example:
|
||||||
--- <pre>
|
--- <pre>
|
||||||
--- vim.keymap.set('n', 'asdf', function() return require('jkl').my_fun() end)
|
--- vim.keymap.set('n', 'asdf', function() return require('jkl').my_fun() end)
|
||||||
|
@@ -133,7 +133,7 @@ Integer nvim_buf_line_count(Buffer buffer, Error *err)
|
|||||||
/// - buffer handle
|
/// - buffer handle
|
||||||
/// - on_reload: Lua callback invoked on reload. The entire buffer
|
/// - on_reload: Lua callback invoked on reload. The entire buffer
|
||||||
/// content should be considered changed. Args:
|
/// content should be considered changed. Args:
|
||||||
/// - the string "detach"
|
/// - the string "reload"
|
||||||
/// - buffer handle
|
/// - buffer handle
|
||||||
/// - utf_sizes: include UTF-32 and UTF-16 size of the replaced
|
/// - utf_sizes: include UTF-32 and UTF-16 size of the replaced
|
||||||
/// region, as args to `on_lines`.
|
/// region, as args to `on_lines`.
|
||||||
|
@@ -138,9 +138,9 @@ describe('put command', function()
|
|||||||
end -- create_test_defs() }}}
|
end -- create_test_defs() }}}
|
||||||
|
|
||||||
local function find_cursor_position(expect_string) -- {{{
|
local function find_cursor_position(expect_string) -- {{{
|
||||||
-- There must only be one occurance of the character 'x' in
|
-- There must only be one occurrence of the character 'x' in
|
||||||
-- expect_string.
|
-- expect_string.
|
||||||
-- This function removes that occurance, and returns the position that
|
-- This function removes that occurrence, and returns the position that
|
||||||
-- it was in.
|
-- it was in.
|
||||||
-- This returns the cursor position that would leave the 'x' in that
|
-- This returns the cursor position that would leave the 'x' in that
|
||||||
-- place if we feed 'ix<esc>' and the string existed before it.
|
-- place if we feed 'ix<esc>' and the string existed before it.
|
||||||
|
@@ -482,7 +482,7 @@ describe('Signs', function()
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('ignores signs with no icon and text when calculting the signcolumn width', function()
|
it('ignores signs with no icon and text when calculating the signcolumn width', function()
|
||||||
feed('ia<cr>b<cr>c<cr><esc>')
|
feed('ia<cr>b<cr>c<cr><esc>')
|
||||||
command('set number')
|
command('set number')
|
||||||
command('set signcolumn=auto:2')
|
command('set signcolumn=auto:2')
|
||||||
|
Reference in New Issue
Block a user