docs: fix typos (#21196)

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
This commit is contained in:
dundargoc
2022-11-29 02:45:48 +01:00
committed by GitHub
parent 0badfaa6d0
commit 615f124003
15 changed files with 36 additions and 34 deletions

View File

@@ -809,7 +809,7 @@ nvim_feedkeys({keys}, {mode}, {escape_ks}) *nvim_feedkeys()*
Parameters: ~ Parameters: ~
• {keys} to be typed • {keys} to be typed
• {mode} behavior flags, see |feedkeys()| • {mode} behavior flags, see |feedkeys()|
• {escape_ks} If true, escape K_SPECIAL bytes in `keys` This should be • {escape_ks} If true, escape K_SPECIAL bytes in `keys`. This should be
false if you already used |nvim_replace_termcodes()|, and false if you already used |nvim_replace_termcodes()|, and
true otherwise. true otherwise.

View File

@@ -1651,7 +1651,7 @@ There are three different types of searching:
with depth limiter (/usr/**2) or upward search (;) notations. with depth limiter (/usr/**2) or upward search (;) notations.
============================================================================== ==============================================================================
11. Trusted Files *trust* 12. Trusted Files *trust*
Nvim has the ability to execute arbitrary code through the 'exrc' option. In Nvim has the ability to execute arbitrary code through the 'exrc' option. In
order to prevent executing code from untrusted sources, Nvim has the concept of order to prevent executing code from untrusted sources, Nvim has the concept of

View File

@@ -450,8 +450,8 @@ The default "PopUp" menu is: >
anoremenu PopUp.Paste "+gP anoremenu PopUp.Paste "+gP
vnoremenu PopUp.Paste "+P vnoremenu PopUp.Paste "+P
vnoremenu PopUp.Delete "_x vnoremenu PopUp.Delete "_x
nnoremenu PopUp.Select\ All> ggVG nnoremenu PopUp.Select\ All ggVG
vnoremenu PopUp.Select\ All> gg0oG$ vnoremenu PopUp.Select\ All gg0oG$
inoremenu PopUp.Select\ All <C-Home><C-O>VG inoremenu PopUp.Select\ All <C-Home><C-O>VG
anoremenu PopUp.-1- <Nop> anoremenu PopUp.-1- <Nop>
anoremenu PopUp.How-to\ disable\ mouse <Cmd>help disable-mouse<CR> anoremenu PopUp.How-to\ disable\ mouse <Cmd>help disable-mouse<CR>

View File

@@ -1416,7 +1416,7 @@ buf_highlight_references({bufnr}, {references}, {offset_encoding})
• {offset_encoding} (string) One of "utf-8", "utf-16", "utf-32". • {offset_encoding} (string) One of "utf-8", "utf-16", "utf-32".
See also: ~ See also: ~
https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentContentChangeEvent
*vim.lsp.util.character_offset()* *vim.lsp.util.character_offset()*
character_offset({buf}, {row}, {col}, {offset_encoding}) character_offset({buf}, {row}, {col}, {offset_encoding})
@@ -1952,7 +1952,7 @@ compute_diff({___MissingCloseParenHere___})
• {offset_encoding} (string) encoding requested by language server • {offset_encoding} (string) encoding requested by language server
Return: ~ Return: ~
(table) TextDocumentContentChangeEvent see https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#textDocumentContentChangeEvent (table) TextDocumentContentChangeEvent see https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentContentChangeEvent
============================================================================== ==============================================================================

View File

@@ -392,7 +392,7 @@ end
---@param lastline number line to begin search in old_lines for last difference ---@param lastline number line to begin search in old_lines for last difference
---@param new_lastline number line to begin search in new_lines for last difference ---@param new_lastline number line to begin search in new_lines for last difference
---@param offset_encoding string encoding requested by language server ---@param offset_encoding string encoding requested by language server
---@returns table TextDocumentContentChangeEvent see https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#textDocumentContentChangeEvent ---@returns table TextDocumentContentChangeEvent see https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentContentChangeEvent
function M.compute_diff( function M.compute_diff(
prev_lines, prev_lines,
curr_lines, curr_lines,

View File

@@ -1679,7 +1679,7 @@ do --[[ References ]]
---@param bufnr number Buffer id ---@param bufnr number Buffer id
---@param references table List of `DocumentHighlight` objects to highlight ---@param references table List of `DocumentHighlight` objects to highlight
---@param offset_encoding string One of "utf-8", "utf-16", "utf-32". ---@param offset_encoding string One of "utf-8", "utf-16", "utf-32".
---@see https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight ---@see https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentContentChangeEvent
function M.buf_highlight_references(bufnr, references, offset_encoding) function M.buf_highlight_references(bufnr, references, offset_encoding)
validate({ validate({
bufnr = { bufnr, 'n', true }, bufnr = { bufnr, 'n', true },

View File

@@ -236,7 +236,7 @@ void nvim_set_hl_ns_fast(Integer ns_id, Error *err)
/// ///
/// @param keys to be typed /// @param keys to be typed
/// @param mode behavior flags, see |feedkeys()| /// @param mode behavior flags, see |feedkeys()|
/// @param escape_ks If true, escape K_SPECIAL bytes in `keys` /// @param escape_ks If true, escape K_SPECIAL bytes in `keys`.
/// This should be false if you already used /// This should be false if you already used
/// |nvim_replace_termcodes()|, and true otherwise. /// |nvim_replace_termcodes()|, and true otherwise.
/// @see feedkeys() /// @see feedkeys()

View File

@@ -2342,7 +2342,9 @@ void check_end_reg_executing(bool advance)
static int vgetorpeek(bool advance) static int vgetorpeek(bool advance)
{ {
int c, c1; int c, c1;
bool timedout = false; // waited for more than 1 second for mapping to complete bool timedout = false; // waited for more than 'timeoutlen'
// for mapping to complete or
// 'ttimeoutlen' for complete key code
int mapdepth = 0; // check for recursive mapping int mapdepth = 0; // check for recursive mapping
bool mode_deleted = false; // set when mode has been deleted bool mode_deleted = false; // set when mode has been deleted
int new_wcol, new_wrow; int new_wcol, new_wrow;

View File

@@ -6642,7 +6642,7 @@ func Test_invalid_function_names()
endtry endtry
call assert_equal(1, caught_e884) call assert_equal(1, caught_e884)
" function name folowed by # " function name followed by #
let caught_e128 = 0 let caught_e128 = 0
try try
func! test2() "# func! test2() "#

View File

@@ -810,7 +810,7 @@ describe('API: buffer events:', function()
local newlines = args[5] local newlines = args[5]
-- Size of the contained nvim instance is 23 lines, this might change -- Size of the contained nvim instance is 23 lines, this might change
-- with the test setup. Note updates are continguous. -- with the test setup. Note updates are contiguous.
assert(#newlines <= 23) assert(#newlines <= 23)
for i = 1,#newlines do for i = 1,#newlines do

View File

@@ -19,26 +19,26 @@ describe('API', function()
-- Might be non-zero already (left-over from some other test?), -- Might be non-zero already (left-over from some other test?),
-- but this is not what is tested here. -- but this is not what is tested here.
local initial_childs = request('nvim_get_proc_children', this_pid) local initial_children = request('nvim_get_proc_children', this_pid)
local job1 = funcs.jobstart(nvim_argv) local job1 = funcs.jobstart(nvim_argv)
retry(nil, nil, function() retry(nil, nil, function()
eq(#initial_childs + 1, #request('nvim_get_proc_children', this_pid)) eq(#initial_children + 1, #request('nvim_get_proc_children', this_pid))
end) end)
local job2 = funcs.jobstart(nvim_argv) local job2 = funcs.jobstart(nvim_argv)
retry(nil, nil, function() retry(nil, nil, function()
eq(#initial_childs + 2, #request('nvim_get_proc_children', this_pid)) eq(#initial_children + 2, #request('nvim_get_proc_children', this_pid))
end) end)
funcs.jobstop(job1) funcs.jobstop(job1)
retry(nil, nil, function() retry(nil, nil, function()
eq(#initial_childs + 1, #request('nvim_get_proc_children', this_pid)) eq(#initial_children + 1, #request('nvim_get_proc_children', this_pid))
end) end)
funcs.jobstop(job2) funcs.jobstop(job2)
retry(nil, nil, function() retry(nil, nil, function()
eq(#initial_childs, #request('nvim_get_proc_children', this_pid)) eq(#initial_children, #request('nvim_get_proc_children', this_pid))
end) end)
end) end)

View File

@@ -3042,7 +3042,7 @@ describe('API', function()
meths.buf_set_mark(buf, 'F', 2, 2, {}) meths.buf_set_mark(buf, 'F', 2, 2, {})
meths.buf_set_name(buf, "mybuf") meths.buf_set_name(buf, "mybuf")
local mark = meths.get_mark('F', {}) local mark = meths.get_mark('F', {})
-- Compare the path tail ony -- Compare the path tail only
assert(string.find(mark[4], "mybuf$")) assert(string.find(mark[4], "mybuf$"))
eq({2, 2, buf.id, mark[4]}, mark) eq({2, 2, buf.id, mark[4]}, mark)
end) end)

View File

@@ -153,7 +153,7 @@ describe('fileio', function()
end) end)
it('backup symlinked files in first avialable backupdir #11349', function() it('backup symlinked files in first available backupdir #11349', function()
skip(is_ci('cirrus')) skip(is_ci('cirrus'))
clear() clear()

View File

@@ -160,25 +160,25 @@ describe('lua stdlib', function()
it("vim.str_utfindex/str_byteindex", function() it("vim.str_utfindex/str_byteindex", function()
exec_lua([[_G.test_text = "xy åäö ɧ 汉语 ↥ 🤦x🦄 å بِيَّ\000ъ"]]) exec_lua([[_G.test_text = "xy åäö ɧ 汉语 ↥ 🤦x🦄 å بِيَّ\000ъ"]])
local indicies32 = {[0]=0,1,2,3,5,7,9,10,12,13,16,19,20,23,24,28,29,33,34,35,37,38,40,42,44,46,48,49,51} local indices32 = {[0]=0,1,2,3,5,7,9,10,12,13,16,19,20,23,24,28,29,33,34,35,37,38,40,42,44,46,48,49,51}
local indicies16 = {[0]=0,1,2,3,5,7,9,10,12,13,16,19,20,23,24,28,28,29,33,33,34,35,37,38,40,42,44,46,48,49,51} local indices16 = {[0]=0,1,2,3,5,7,9,10,12,13,16,19,20,23,24,28,28,29,33,33,34,35,37,38,40,42,44,46,48,49,51}
for i,k in pairs(indicies32) do for i,k in pairs(indices32) do
eq(k, exec_lua("return vim.str_byteindex(_G.test_text, ...)", i), i) eq(k, exec_lua("return vim.str_byteindex(_G.test_text, ...)", i), i)
end end
for i,k in pairs(indicies16) do for i,k in pairs(indices16) do
eq(k, exec_lua("return vim.str_byteindex(_G.test_text, ..., true)", i), i) eq(k, exec_lua("return vim.str_byteindex(_G.test_text, ..., true)", i), i)
end end
eq("index out of range", pcall_err(exec_lua, "return vim.str_byteindex(_G.test_text, ...)", #indicies32 + 1)) eq("index out of range", pcall_err(exec_lua, "return vim.str_byteindex(_G.test_text, ...)", #indices32 + 1))
eq("index out of range", pcall_err(exec_lua, "return vim.str_byteindex(_G.test_text, ..., true)", #indicies16 + 1)) eq("index out of range", pcall_err(exec_lua, "return vim.str_byteindex(_G.test_text, ..., true)", #indices16 + 1))
local i32, i16 = 0, 0 local i32, i16 = 0, 0
local len = 51 local len = 51
for k = 0,len do for k = 0,len do
if indicies32[i32] < k then if indices32[i32] < k then
i32 = i32 + 1 i32 = i32 + 1
end end
if indicies16[i16] < k then if indices16[i16] < k then
i16 = i16 + 1 i16 = i16 + 1
if indicies16[i16+1] == indicies16[i16] then if indices16[i16+1] == indices16[i16] then
i16 = i16 + 1 i16 = i16 + 1
end end
end end

View File

@@ -61,7 +61,7 @@ before_each(function()
endwhile endwhile
return ret return ret
endfunction endfunction
function SplittedMultibyteStart(cmdline) function SplitMultibyteStart(cmdline)
let ret = [] let ret = []
let i = 0 let i = 0
while i < len(a:cmdline) while i < len(a:cmdline)
@@ -77,7 +77,7 @@ before_each(function()
endwhile endwhile
return ret return ret
endfunction endfunction
function SplittedMultibyteEnd(cmdline) function SplitMultibyteEnd(cmdline)
let ret = [] let ret = []
let i = 0 let i = 0
while i < len(a:cmdline) while i < len(a:cmdline)
@@ -296,7 +296,7 @@ describe('Command-line coloring', function()
end end
it('does the right thing when hl start appears to split multibyte char', it('does the right thing when hl start appears to split multibyte char',
function() function()
set_color_cb('SplittedMultibyteStart') set_color_cb('SplitMultibyteStart')
start_prompt('echo "«') start_prompt('echo "«')
screen:expect{grid=[[ screen:expect{grid=[[
| |
@@ -322,7 +322,7 @@ describe('Command-line coloring', function()
end) end)
it('does the right thing when hl end appears to split multibyte char', it('does the right thing when hl end appears to split multibyte char',
function() function()
set_color_cb('SplittedMultibyteEnd') set_color_cb('SplitMultibyteEnd')
start_prompt('echo "«') start_prompt('echo "«')
screen:expect([[ screen:expect([[
| |
@@ -409,7 +409,7 @@ describe('Command-line coloring', function()
]]) ]])
end) end)
it('stops executing callback after a number of errors', function() it('stops executing callback after a number of errors', function()
set_color_cb('SplittedMultibyteStart') set_color_cb('SplitMultibyteStart')
start_prompt('let x = "«»«»«»«»«»"') start_prompt('let x = "«»«»«»«»«»"')
screen:expect([[ screen:expect([[
| |
@@ -772,7 +772,7 @@ describe('Ex commands coloring', function()
]]) ]])
end) end)
it('still executes command-line even if errored out', function() it('still executes command-line even if errored out', function()
meths.set_var('Nvim_color_cmdline', 'SplittedMultibyteStart') meths.set_var('Nvim_color_cmdline', 'SplitMultibyteStart')
feed(':let x = "«"\n') feed(':let x = "«"\n')
eq('«', meths.get_var('x')) eq('«', meths.get_var('x'))
local msg = 'E5405: Chunk 0 start 10 splits multibyte character' local msg = 'E5405: Chunk 0 start 10 splits multibyte character'