docs: fix typos (#20394)

Co-authored-by: Raphael <glephunter@gmail.com>
Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
dundargoc
2022-09-30 09:53:52 +02:00
committed by GitHub
parent 9cf252e121
commit df646572c5
40 changed files with 67 additions and 67 deletions

View File

@@ -2579,7 +2579,7 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts})
• virt_text : virtual text to link to this mark. A list of • virt_text : virtual text to link to this mark. A list of
[text, highlight] tuples, each representing a text chunk [text, highlight] tuples, each representing a text chunk
with specified highlight. `highlight` element can either with specified highlight. `highlight` element can either
be a a single highlight group, or an array of multiple be a single highlight group, or an array of multiple
highlight groups that will be stacked (highest priority highlight groups that will be stacked (highest priority
last). A highlight group can be supplied either as a last). A highlight group can be supplied either as a
string or as an integer, the latter which can be obtained string or as an integer, the latter which can be obtained
@@ -2897,7 +2897,7 @@ nvim_win_set_hl_ns({window}, {ns_id}) *nvim_win_set_hl_ns()*
Set highlight namespace for a window. This will use highlights defined in Set highlight namespace for a window. This will use highlights defined in
this namespace, but fall back to global highlights (ns=0) when missing. this namespace, but fall back to global highlights (ns=0) when missing.
This takes predecence over the 'winhighlight' option. This takes precedence over the 'winhighlight' option.
Parameters: ~ Parameters: ~
{ns_id} the namespace to use {ns_id} the namespace to use

View File

@@ -489,7 +489,7 @@ backup.vim
http://www.vim.org/scripts/script.php?script_id=1537 http://www.vim.org/scripts/script.php?script_id=1537
Keeps as many backups as you like so you don't have to. Keeps as many backups as you like so you don't have to.
rainbow_parenthsis.vim rainbow_parenthesis.vim
http://www.vim.org/scripts/script.php?script_id=1561 http://www.vim.org/scripts/script.php?script_id=1561
Very helpful since Ada uses only '(' and ')'. Very helpful since Ada uses only '(' and ')'.

View File

@@ -3355,7 +3355,7 @@ uv.getnameinfo({address} [, {callback}]) *uv.getnameinfo()*
- `family`: `string` or `integer` or `nil` - `family`: `string` or `integer` or `nil`
- `callback`: `callable` (async version) or `nil` (sync - `callback`: `callable` (async version) or `nil` (sync
version) version)
- `err`: `nil` or `sring` - `err`: `nil` or `string`
- `host`: `string` or `nil` - `host`: `string` or `nil`
- `service`: `string` or `nil` - `service`: `string` or `nil`

View File

@@ -1340,7 +1340,7 @@ A jump table for the options with a short description can be found at |Q_op|.
used. The command-line will cover the last line of the screen when used. The command-line will cover the last line of the screen when
shown. shown.
WARNING: `cmdheight=0` is considered experimental. Except some WARNING: `cmdheight=0` is considered experimental. Expect some
unwanted behaviour. Some 'shortmess' flags and similar unwanted behaviour. Some 'shortmess' flags and similar
mechanism might fail to take effect, causing unwanted hit-enter mechanism might fail to take effect, causing unwanted hit-enter
prompts. Some informative messages, both from Nvim itself and prompts. Some informative messages, both from Nvim itself and

View File

@@ -2365,7 +2365,7 @@ you set the variable: >
:let papp_include_html=1 :let papp_include_html=1
in your startup file it will try to syntax-hilight html code inside phtml in your startup file it will try to syntax-highlight html code inside phtml
sections, but this is relatively slow and much too colourful to be able to sections, but this is relatively slow and much too colourful to be able to
edit sensibly. ;) edit sensibly. ;)

View File

@@ -476,7 +476,7 @@ function M.apply_text_edits(text_edits, bufnr, offset_encoding)
-- If the replacement is over the end of a line (i.e. e.end_col is out of bounds and the -- If the replacement is over the end of a line (i.e. e.end_col is out of bounds and the
-- replacement text ends with a newline We can likely assume that the replacement is assumed -- replacement text ends with a newline We can likely assume that the replacement is assumed
-- to be meant to replace the newline with another newline and we need to make sure this -- to be meant to replace the newline with another newline and we need to make sure this
-- doens't add an extra empty line. E.g. when the last line to be replaced contains a '\r' -- doesn't add an extra empty line. E.g. when the last line to be replaced contains a '\r'
-- in the file some servers (clangd on windows) will include that character in the line -- in the file some servers (clangd on windows) will include that character in the line
-- while nvim_buf_set_text doesn't count it as part of the line. -- while nvim_buf_set_text doesn't count it as part of the line.
if if

View File

@@ -202,7 +202,7 @@ _ERROR_CATEGORIES = [
'whitespace/cast', 'whitespace/cast',
] ]
# The default state of the category filter. This is overrided by the --filter= # The default state of the category filter. This is overridden by the --filter=
# flag. By default all errors are on, so only add here categories that should be # flag. By default all errors are on, so only add here categories that should be
# off by default (i.e., categories that must be enabled by the --filter= flags). # off by default (i.e., categories that must be enabled by the --filter= flags).
# All entries here should start with a '-' or '+', as in the --filter= flag. # All entries here should start with a '-' or '+', as in the --filter= flag.

View File

@@ -389,7 +389,7 @@ Array nvim_buf_get_extmarks(Buffer buffer, Integer ns_id, Object start, Object e
/// - virt_text : virtual text to link to this mark. /// - virt_text : virtual text to link to this mark.
/// A list of [text, highlight] tuples, each representing a /// A list of [text, highlight] tuples, each representing a
/// text chunk with specified highlight. `highlight` element /// text chunk with specified highlight. `highlight` element
/// can either be a a single highlight group, or an array of /// can either be a single highlight group, or an array of
/// multiple highlight groups that will be stacked /// multiple highlight groups that will be stacked
/// (highest priority last). A highlight group can be supplied /// (highest priority last). A highlight group can be supplied
/// either as a string or as an integer, the latter which /// either as a string or as an integer, the latter which

View File

@@ -430,7 +430,7 @@ Object nvim_win_call(Window window, LuaRef fun, Error *err)
/// Set highlight namespace for a window. This will use highlights defined in /// Set highlight namespace for a window. This will use highlights defined in
/// this namespace, but fall back to global highlights (ns=0) when missing. /// this namespace, but fall back to global highlights (ns=0) when missing.
/// ///
/// This takes predecence over the 'winhighlight' option. /// This takes precedence over the 'winhighlight' option.
/// ///
/// @param ns_id the namespace to use /// @param ns_id the namespace to use
/// @param[out] err Error details, if any /// @param[out] err Error details, if any

View File

@@ -999,7 +999,7 @@ int copy_indent(int size, char *src)
/// "second_line_indent": indent for after ^^D in Insert mode or if flag /// "second_line_indent": indent for after ^^D in Insert mode or if flag
/// OPENLINE_COM_LIST /// OPENLINE_COM_LIST
/// "did_do_comment" is set to true when intentionally putting the comment /// "did_do_comment" is set to true when intentionally putting the comment
/// leader in fromt of the new line. /// leader in front of the new line.
/// ///
/// @param dir FORWARD or BACKWARD /// @param dir FORWARD or BACKWARD
/// ///

View File

@@ -650,7 +650,7 @@ static inline unsigned nr2hex(unsigned n)
/// ///
/// @param b /// @param b
/// ///
/// @reeturn Number of display cells. /// @return Number of display cells.
int byte2cells(int b) int byte2cells(int b)
FUNC_ATTR_PURE FUNC_ATTR_PURE
{ {

View File

@@ -2104,7 +2104,7 @@ static int handle_mapping(int *keylenp, bool *timedout, int *mapdepth)
} else { } else {
keylen = 0; keylen = 0;
} }
if (keylen == 0) { // no simplication has been done if (keylen == 0) { // no simplification has been done
// If there was no mapping at all use the character from the // If there was no mapping at all use the character from the
// typeahead buffer right here. // typeahead buffer right here.
if (mp == NULL) { if (mp == NULL) {

View File

@@ -265,7 +265,7 @@ void hash_unlock(hashtab_T *ht)
hash_may_resize(ht, 0); hash_may_resize(ht, 0);
} }
/// Resize hastable (new size can be given or automatically computed). /// Resize hashtable (new size can be given or automatically computed).
/// ///
/// @param minitems Minimum number of items the new table should hold. /// @param minitems Minimum number of items the new table should hold.
/// If zero, new size will depend on currently used items: /// If zero, new size will depend on currently used items:

View File

@@ -2034,7 +2034,7 @@ void highlight_changed(void)
} }
} }
// sentinel value. used when no hightlight namespace is active // sentinel value. used when no highlight namespace is active
highlight_attr[HLF_COUNT] = 0; highlight_attr[HLF_COUNT] = 0;
// //

View File

@@ -1369,7 +1369,7 @@ static int query_inspect(lua_State *L)
lua_rawseti(L, -2, nextitem++); // [retval, patterns, pat, pred] lua_rawseti(L, -2, nextitem++); // [retval, patterns, pat, pred]
} }
// last predicate should have ended with TypeDone // last predicate should have ended with TypeDone
lua_pop(L, 1); // [retval, patters, pat] lua_pop(L, 1); // [retval, patterns, pat]
lua_rawseti(L, -2, (int)i + 1); // [retval, patterns] lua_rawseti(L, -2, (int)i + 1); // [retval, patterns]
} }
lua_setfield(L, -2, "patterns"); // [retval] lua_setfield(L, -2, "patterns"); // [retval]

View File

@@ -805,7 +805,7 @@ done:
/// char *output = NULL; /// char *output = NULL;
/// size_t nread = 0; /// size_t nread = 0;
/// char *argv[] = {"ls", "-la", NULL}; /// char *argv[] = {"ls", "-la", NULL};
/// int exitcode = os_sytem(argv, NULL, 0, &output, &nread); /// int exitcode = os_system(argv, NULL, 0, &output, &nread);
/// ///
/// @param argv The commandline arguments to be passed to the shell. `argv` /// @param argv The commandline arguments to be passed to the shell. `argv`
/// will be consumed. /// will be consumed.

View File

@@ -575,7 +575,7 @@ bool path_has_exp_wildcard(const char_u *p)
/// @param path The path to search. /// @param path The path to search.
/// @param flags Flags for regexp expansion. /// @param flags Flags for regexp expansion.
/// - EW_ICASE: Ignore case. /// - EW_ICASE: Ignore case.
/// - EW_NOERROR: Silence error messeges. /// - EW_NOERROR: Silence error messages.
/// - EW_NOTWILD: Add matches literally. /// - EW_NOTWILD: Add matches literally.
/// @returns the number of matches found. /// @returns the number of matches found.
static size_t path_expand(garray_T *gap, const char_u *path, int flags) static size_t path_expand(garray_T *gap, const char_u *path, int flags)

View File

@@ -1503,7 +1503,7 @@ bool current_quote(oparg_T *oap, long count, bool include, int quotechar)
bool inside_quotes = false; // Looks like "i'" done before bool inside_quotes = false; // Looks like "i'" done before
bool selected_quote = false; // Has quote inside selection bool selected_quote = false; // Has quote inside selection
int i; int i;
bool restore_vis_bef = false; // resotre VIsual on abort bool restore_vis_bef = false; // restore VIsual on abort
// When 'selection' is "exclusive" move the cursor to where it would be // When 'selection' is "exclusive" move the cursor to where it would be
// with 'selection' "inclusive", so that the logic is the same for both. // with 'selection' "inclusive", so that the logic is the same for both.

View File

@@ -737,7 +737,7 @@ void win_set_minimal_style(win_T *wp)
} }
// TODO(bfredl): this could use a highlight namespace directly, // TODO(bfredl): this could use a highlight namespace directly,
// and avoid pecularities around window options // and avoid peculiarities around window options
char_u *old = (char_u *)wp->w_p_winhl; char_u *old = (char_u *)wp->w_p_winhl;
wp->w_p_winhl = ((*old == NUL) wp->w_p_winhl = ((*old == NUL)
? xstrdup("EndOfBuffer:") ? xstrdup("EndOfBuffer:")

View File

@@ -1046,7 +1046,7 @@ describe('API/extmarks', function()
check_undo_redo(ns, marks[3], 0, 4, 0, 8) check_undo_redo(ns, marks[3], 0, 4, 0, 8)
end) end)
it('substitions over multiple lines with newline in pattern', function() it('substitutes over multiple lines with newline in pattern', function()
feed('A<cr>67890<cr>xx<esc>') feed('A<cr>67890<cr>xx<esc>')
set_extmark(ns, marks[1], 0, 3) set_extmark(ns, marks[1], 0, 3)
set_extmark(ns, marks[2], 0, 4) set_extmark(ns, marks[2], 0, 4)
@@ -1078,7 +1078,7 @@ describe('API/extmarks', function()
check_undo_redo(ns, marks[6], 1, 2, 0, 5) check_undo_redo(ns, marks[6], 1, 2, 0, 5)
end) end)
it('substitions with multiple newlines in pattern', function() it('substitutes with multiple newlines in pattern', function()
feed('A<cr>67890<cr>xx<esc>') feed('A<cr>67890<cr>xx<esc>')
set_extmark(ns, marks[1], 0, 4) set_extmark(ns, marks[1], 0, 4)
set_extmark(ns, marks[2], 0, 5) set_extmark(ns, marks[2], 0, 5)
@@ -1093,7 +1093,7 @@ describe('API/extmarks', function()
check_undo_redo(ns, marks[5], 2, 0, 0, 6) check_undo_redo(ns, marks[5], 2, 0, 0, 6)
end) end)
it('substitions over multiple lines with replace in substition', function() it('substitutes over multiple lines with replace in substitution', function()
feed('A<cr>67890<cr>xx<esc>') feed('A<cr>67890<cr>xx<esc>')
set_extmark(ns, marks[1], 0, 1) set_extmark(ns, marks[1], 0, 1)
set_extmark(ns, marks[2], 0, 2) set_extmark(ns, marks[2], 0, 2)
@@ -1111,7 +1111,7 @@ describe('API/extmarks', function()
eq({1, 3}, get_extmark_by_id(ns, marks[3])) eq({1, 3}, get_extmark_by_id(ns, marks[3]))
end) end)
it('substitions over multiple lines with replace in substition', function() it('substitutes over multiple lines with replace in substitution', function()
feed('A<cr>x3<cr>xx<esc>') feed('A<cr>x3<cr>xx<esc>')
set_extmark(ns, marks[1], 1, 0) set_extmark(ns, marks[1], 1, 0)
set_extmark(ns, marks[2], 1, 1) set_extmark(ns, marks[2], 1, 1)
@@ -1122,7 +1122,7 @@ describe('API/extmarks', function()
check_undo_redo(ns, marks[3], 1, 2, 2, 0) check_undo_redo(ns, marks[3], 1, 2, 2, 0)
end) end)
it('substitions over multiple lines with replace in substition', function() it('substitutes over multiple lines with replace in substitution', function()
feed('A<cr>x3<cr>xx<esc>') feed('A<cr>x3<cr>xx<esc>')
set_extmark(ns, marks[1], 0, 1) set_extmark(ns, marks[1], 0, 1)
set_extmark(ns, marks[2], 0, 2) set_extmark(ns, marks[2], 0, 2)
@@ -1140,7 +1140,7 @@ describe('API/extmarks', function()
check_undo_redo(ns, marks[3], 0, 4, 1, 3) check_undo_redo(ns, marks[3], 0, 4, 1, 3)
end) end)
it('substitions with newline in match and sub, delta is 0', function() it('substitutes with newline in match and sub, delta is 0', function()
feed('A<cr>67890<cr>xx<esc>') feed('A<cr>67890<cr>xx<esc>')
set_extmark(ns, marks[1], 0, 3) set_extmark(ns, marks[1], 0, 3)
set_extmark(ns, marks[2], 0, 4) set_extmark(ns, marks[2], 0, 4)
@@ -1157,7 +1157,7 @@ describe('API/extmarks', function()
check_undo_redo(ns, marks[6], 2, 0, 2, 0) check_undo_redo(ns, marks[6], 2, 0, 2, 0)
end) end)
it('substitions with newline in match and sub, delta > 0', function() it('substitutes with newline in match and sub, delta > 0', function()
feed('A<cr>67890<cr>xx<esc>') feed('A<cr>67890<cr>xx<esc>')
set_extmark(ns, marks[1], 0, 3) set_extmark(ns, marks[1], 0, 3)
set_extmark(ns, marks[2], 0, 4) set_extmark(ns, marks[2], 0, 4)
@@ -1174,7 +1174,7 @@ describe('API/extmarks', function()
check_undo_redo(ns, marks[6], 2, 0, 3, 0) check_undo_redo(ns, marks[6], 2, 0, 3, 0)
end) end)
it('substitions with newline in match and sub, delta < 0', function() it('substitutes with newline in match and sub, delta < 0', function()
feed('A<cr>67890<cr>xx<cr>xx<esc>') feed('A<cr>67890<cr>xx<cr>xx<esc>')
set_extmark(ns, marks[1], 0, 3) set_extmark(ns, marks[1], 0, 3)
set_extmark(ns, marks[2], 0, 4) set_extmark(ns, marks[2], 0, 4)
@@ -1193,7 +1193,7 @@ describe('API/extmarks', function()
check_undo_redo(ns, marks[7], 3, 0, 2, 0) check_undo_redo(ns, marks[7], 3, 0, 2, 0)
end) end)
it('substitions with backrefs, newline inserted into sub', function() it('substitutes with backrefs, newline inserted into sub', function()
feed('A<cr>67890<cr>xx<cr>xx<esc>') feed('A<cr>67890<cr>xx<cr>xx<esc>')
set_extmark(ns, marks[1], 0, 3) set_extmark(ns, marks[1], 0, 3)
set_extmark(ns, marks[2], 0, 4) set_extmark(ns, marks[2], 0, 4)
@@ -1210,7 +1210,7 @@ describe('API/extmarks', function()
check_undo_redo(ns, marks[6], 2, 0, 3, 0) check_undo_redo(ns, marks[6], 2, 0, 3, 0)
end) end)
it('substitions a ^', function() it('substitutes a ^', function()
set_extmark(ns, marks[1], 0, 0) set_extmark(ns, marks[1], 0, 0)
set_extmark(ns, marks[2], 0, 1) set_extmark(ns, marks[2], 0, 1)
feed([[:s:^:x<cr>]]) feed([[:s:^:x<cr>]])
@@ -1397,7 +1397,7 @@ describe('API/extmarks', function()
eq({{id, 1, 0}}, bufmeths.get_extmarks(buf, ns, 0, -1, {})) eq({{id, 1, 0}}, bufmeths.get_extmarks(buf, ns, 0, -1, {}))
end) end)
it('does not crash with append/delete/undo seqence', function() it('does not crash with append/delete/undo sequence', function()
meths.exec([[ meths.exec([[
let ns = nvim_create_namespace('myplugin') let ns = nvim_create_namespace('myplugin')
call nvim_buf_set_extmark(0, ns, 0, 0, {}) call nvim_buf_set_extmark(0, ns, 0, 0, {})

View File

@@ -885,7 +885,7 @@ describe('nvim_set_keymap, nvim_del_keymap', function()
eq({'<space>'}, meths.buf_get_lines(0, 0, -1, false)) eq({'<space>'}, meths.buf_get_lines(0, 0, -1, false))
end) end)
it('lua expr mapping returning nil is equivalent to returnig an empty string', function() it('lua expr mapping returning nil is equivalent to returning an empty string', function()
exec_lua [[ exec_lua [[
vim.api.nvim_set_keymap ('i', 'aa', '', {callback = function() return nil end, expr = true }) vim.api.nvim_set_keymap ('i', 'aa', '', {callback = function() return nil end, expr = true })
]] ]]

View File

@@ -7,7 +7,7 @@ describe(':qa', function()
end) end)
it('verify #3334', function() it('verify #3334', function()
-- just testing if 'qa' passed as a program argument wont result in memory -- just testing if 'qa' passed as a program argument won't result in memory
-- errors -- errors
end) end)
end) end)

View File

@@ -255,7 +255,7 @@ describe('fileformats option', function()
-- Assert buffer contents. This has to be done manually as -- Assert buffer contents. This has to be done manually as
-- helpers.expect() calls helpers.dedent() which messes up the white space -- helpers.expect() calls helpers.dedent() which messes up the white space
-- and carrige returns. -- and carriage returns.
eq( eq(
'unix\n'.. 'unix\n'..
'unix\n'.. 'unix\n'..

View File

@@ -907,7 +907,7 @@ describe('list and dictionary types', function()
feed('o<C-R>=a<CR><esc>') feed('o<C-R>=a<CR><esc>')
feed_command('lang C') feed_command('lang C')
feed_command('redir => a') feed_command('redir => a')
-- The test failes if this is not in one line. -- The test fails if this is not in one line.
feed_command("try|foobar|catch|let a = matchstr(v:exception,'^[^ ]*')|endtry") feed_command("try|foobar|catch|let a = matchstr(v:exception,'^[^ ]*')|endtry")
feed_command('redir END') feed_command('redir END')
feed('o<C-R>=a<CR><esc>') feed('o<C-R>=a<CR><esc>')

View File

@@ -69,7 +69,7 @@ describe('72', function()
feed_command('set undofile ul=100') feed_command('set undofile ul=100')
feed('uuuuuu:w >>test.out<cr>') feed('uuuuuu:w >>test.out<cr>')
---- Open the output to see if it meets the expections ---- Open the output to see if it meets the expectations
feed_command('e! test.out') feed_command('e! test.out')
-- Assert buffer contents. -- Assert buffer contents.

View File

@@ -26,7 +26,7 @@ describe('tag search with !_TAG_FILE_ENCODING', function()
'!_TAG_FILE_ENCODING cp932 //\n' .. '!_TAG_FILE_ENCODING cp932 //\n' ..
'\130`\130a\130b Xtags2.txt /\130`\130a\130b\n' '\130`\130a\130b Xtags2.txt /\130`\130a\130b\n'
) )
-- The last file is very long but repetetive and can be generated on the -- The last file is very long but repetitive and can be generated on the
-- fly. -- fly.
local text = helpers.dedent([[ local text = helpers.dedent([[
!_TAG_FILE_SORTED 1 // !_TAG_FILE_SORTED 1 //

View File

@@ -211,7 +211,7 @@ describe('au OptionSet', function()
expected_combination({'backup', 0, 0, '', 1, 'local', 'setlocal'}) expected_combination({'backup', 0, 0, '', 1, 'local', 'setlocal'})
end) end)
it('should trigger if the current buffer is different from the targetted buffer', function() it('should trigger if the current buffer is different from the targeted buffer', function()
local new_buffer = make_buffer() local new_buffer = make_buffer()
local new_bufnr = buf.get_number(new_buffer) local new_bufnr = buf.get_number(new_buffer)
@@ -590,7 +590,7 @@ describe('au OptionSet', function()
expected_combination({'backup', 0, 0, '', 1, 'local', 'setlocal'}) expected_combination({'backup', 0, 0, '', 1, 'local', 'setlocal'})
end) end)
it('should trigger if the current buffer is different from the targetted buffer', function() it('should trigger if the current buffer is different from the targeted buffer', function()
set_hook('buftype') set_hook('buftype')
local new_buffer = make_buffer() local new_buffer = make_buffer()
@@ -616,7 +616,7 @@ describe('au OptionSet', function()
expected_combination({'backup', 0, 0, '', 1, 'local', 'setlocal'}) expected_combination({'backup', 0, 0, '', 1, 'local', 'setlocal'})
end) end)
it('should not trigger if the current window is different from the targetted window', function() it('should not trigger if the current window is different from the targeted window', function()
set_hook('cursorcolumn') set_hook('cursorcolumn')
local new_winnr = get_new_window_number() local new_winnr = get_new_window_number()

View File

@@ -166,7 +166,7 @@ describe('luaeval(vim.api.…)', function()
eq({v={}}, funcs.luaeval('vim.api.nvim__id_dictionary({v={[vim.type_idx]=vim.types.array, [vim.val_idx]=10, [5]=1, foo=2}})')) eq({v={}}, funcs.luaeval('vim.api.nvim__id_dictionary({v={[vim.type_idx]=vim.types.array, [vim.val_idx]=10, [5]=1, foo=2}})'))
-- If API requests dictionary, then empty table will be the one. This is not -- If API requests dictionary, then empty table will be the one. This is not
-- the case normally because empty table is an empty arrray. -- the case normally because empty table is an empty array.
eq({}, funcs.luaeval('vim.api.nvim__id_dictionary({})')) eq({}, funcs.luaeval('vim.api.nvim__id_dictionary({})'))
eq(4, eval([[type(luaeval('vim.api.nvim__id_dictionary({})'))]])) eq(4, eval([[type(luaeval('vim.api.nvim__id_dictionary({})'))]]))
end) end)

View File

@@ -333,7 +333,7 @@ describe('lua: nvim_buf_attach on_bytes', function()
start_txt = meths.buf_get_lines(0, 0, -1, true) start_txt = meths.buf_get_lines(0, 0, -1, true)
end end
local shadowbytes = table.concat(start_txt, '\n') .. '\n' local shadowbytes = table.concat(start_txt, '\n') .. '\n'
-- TODO: while we are brewing the real strong coffe, -- TODO: while we are brewing the real strong coffee,
-- verify should check buf_get_offset after every check_events -- verify should check buf_get_offset after every check_events
if verify then if verify then
local len = meths.buf_get_offset(0, meths.buf_line_count(0)) local len = meths.buf_get_offset(0, meths.buf_line_count(0))

View File

@@ -11,7 +11,7 @@ describe('URI methods', function()
describe('file path to uri', function() describe('file path to uri', function()
describe('encode Unix file path', function() describe('encode Unix file path', function()
it('file path includes only ascii charactors', function() it('file path includes only ascii characters', function()
exec_lua("filepath = '/Foo/Bar/Baz.txt'") exec_lua("filepath = '/Foo/Bar/Baz.txt'")
eq('file:///Foo/Bar/Baz.txt', exec_lua("return vim.uri_from_fname(filepath)")) eq('file:///Foo/Bar/Baz.txt', exec_lua("return vim.uri_from_fname(filepath)"))
@@ -23,7 +23,7 @@ describe('URI methods', function()
eq('file:///Foo%20/Bar/Baz.txt', exec_lua("return vim.uri_from_fname(filepath)")) eq('file:///Foo%20/Bar/Baz.txt', exec_lua("return vim.uri_from_fname(filepath)"))
end) end)
it('file path including Unicode charactors', function() it('file path including Unicode characters', function()
exec_lua("filepath = '/xy/åäö/ɧ/汉语/↥/🤦/🦄/å/بِيَّ.txt'") exec_lua("filepath = '/xy/åäö/ɧ/汉语/↥/🤦/🦄/å/بِيَّ.txt'")
-- The URI encoding should be case-insensitive -- The URI encoding should be case-insensitive
@@ -32,7 +32,7 @@ describe('URI methods', function()
end) end)
describe('encode Windows filepath', function() describe('encode Windows filepath', function()
it('file path includes only ascii charactors', function() it('file path includes only ascii characters', function()
exec_lua([[filepath = 'C:\\Foo\\Bar\\Baz.txt']]) exec_lua([[filepath = 'C:\\Foo\\Bar\\Baz.txt']])
eq('file:///C:/Foo/Bar/Baz.txt', exec_lua("return vim.uri_from_fname(filepath)")) eq('file:///C:/Foo/Bar/Baz.txt', exec_lua("return vim.uri_from_fname(filepath)"))
@@ -44,7 +44,7 @@ describe('URI methods', function()
eq('file:///C:/Foo%20/Bar/Baz.txt', exec_lua("return vim.uri_from_fname(filepath)")) eq('file:///C:/Foo%20/Bar/Baz.txt', exec_lua("return vim.uri_from_fname(filepath)"))
end) end)
it('file path including Unicode charactors', function() it('file path including Unicode characters', function()
exec_lua([[filepath = 'C:\\xy\\åäö\\ɧ\\汉语\\↥\\🤦\\🦄\\å\\بِيَّ.txt']]) exec_lua([[filepath = 'C:\\xy\\åäö\\ɧ\\汉语\\↥\\🤦\\🦄\\å\\بِيَّ.txt']])
eq('file:///C:/xy/%c3%a5%c3%a4%c3%b6/%c9%a7/%e6%b1%89%e8%af%ad/%e2%86%a5/%f0%9f%a4%a6/%f0%9f%a6%84/a%cc%8a/%d8%a8%d9%90%d9%8a%d9%8e%d9%91.txt', exec_lua("return vim.uri_from_fname(filepath)")) eq('file:///C:/xy/%c3%a5%c3%a4%c3%b6/%c9%a7/%e6%b1%89%e8%af%ad/%e2%86%a5/%f0%9f%a4%a6/%f0%9f%a6%84/a%cc%8a/%d8%a8%d9%90%d9%8a%d9%8e%d9%91.txt', exec_lua("return vim.uri_from_fname(filepath)"))
@@ -72,7 +72,7 @@ describe('URI methods', function()
eq('/Foo /Bar/Baz.txt', exec_lua("return vim.uri_to_fname(uri)")) eq('/Foo /Bar/Baz.txt', exec_lua("return vim.uri_to_fname(uri)"))
end) end)
it('file path including Unicode charactors', function() it('file path including Unicode characters', function()
local test_case = [[ local test_case = [[
local uri = 'file:///xy/%C3%A5%C3%A4%C3%B6/%C9%A7/%E6%B1%89%E8%AF%AD/%E2%86%A5/%F0%9F%A4%A6/%F0%9F%A6%84/a%CC%8A/%D8%A8%D9%90%D9%8A%D9%8E%D9%91.txt' local uri = 'file:///xy/%C3%A5%C3%A4%C3%B6/%C9%A7/%E6%B1%89%E8%AF%AD/%E2%86%A5/%F0%9F%A4%A6/%F0%9F%A6%84/a%CC%8A/%D8%A8%D9%90%D9%8A%D9%8E%D9%91.txt'
return vim.uri_to_fname(uri) return vim.uri_to_fname(uri)
@@ -83,7 +83,7 @@ describe('URI methods', function()
end) end)
describe('decode Windows filepath', function() describe('decode Windows filepath', function()
it('file path includes only ascii charactors', function() it('file path includes only ascii characters', function()
local test_case = [[ local test_case = [[
local uri = 'file:///C:/Foo/Bar/Baz.txt' local uri = 'file:///C:/Foo/Bar/Baz.txt'
return vim.uri_to_fname(uri) return vim.uri_to_fname(uri)
@@ -119,7 +119,7 @@ describe('URI methods', function()
eq('C:\\Foo \\Bar\\Baz.txt', exec_lua(test_case)) eq('C:\\Foo \\Bar\\Baz.txt', exec_lua(test_case))
end) end)
it('file path including Unicode charactors', function() it('file path including Unicode characters', function()
local test_case = [[ local test_case = [[
local uri = 'file:///C:/xy/%C3%A5%C3%A4%C3%B6/%C9%A7/%E6%B1%89%E8%AF%AD/%E2%86%A5/%F0%9F%A4%A6/%F0%9F%A6%84/a%CC%8A/%D8%A8%D9%90%D9%8A%D9%8E%D9%91.txt' local uri = 'file:///C:/xy/%C3%A5%C3%A4%C3%B6/%C9%A7/%E6%B1%89%E8%AF%AD/%E2%86%A5/%F0%9F%A4%A6/%F0%9F%A6%84/a%CC%8A/%D8%A8%D9%90%D9%8A%D9%8E%D9%91.txt'
return vim.uri_to_fname(uri) return vim.uri_to_fname(uri)

View File

@@ -905,7 +905,7 @@ describe('lua stdlib', function()
]])) ]]))
-- vim.empty_dict() gives new value each time -- vim.empty_dict() gives new value each time
-- equality is not overriden (still by ref) -- equality is not overridden (still by ref)
-- non-empty table uses the usual heuristics (ignores the tag) -- non-empty table uses the usual heuristics (ignores the tag)
eq({false, {"foo"}, {namey="bar"}}, exec_lua([[ eq({false, {"foo"}, {namey="bar"}}, exec_lua([[
local aa = vim.empty_dict() local aa = vim.empty_dict()

View File

@@ -184,7 +184,7 @@ describe("'keymap' / :lmap", function()
feed('il<esc>') feed('il<esc>')
expect('alllaaa') expect('alllaaa')
end) end)
-- This is a problem introduced when introducting :lmap and macro -- This is a problem introduced when introducing :lmap and macro
-- compatibility. There are no plans to fix this as the complexity involved -- compatibility. There are no plans to fix this as the complexity involved
-- seems too great. -- seems too great.
pending('mappings not applied to macro replay of :lnoremap', function() pending('mappings not applied to macro replay of :lnoremap', function()

View File

@@ -310,18 +310,18 @@ describe('clipboard (with fake clipboard.vim)', function()
insert([[ insert([[
text: text:
first line first line
secound line second line
third line]]) third line]])
feed('G"+dd"*dddd"+p"*pp') feed('G"+dd"*dddd"+p"*pp')
expect([[ expect([[
text: text:
third line third line
secound line second line
first line]]) first line]])
-- linewise selection should be encoded as an extra newline -- linewise selection should be encoded as an extra newline
eq({{'third line', ''}, 'V'}, eval("g:test_clip['+']")) eq({{'third line', ''}, 'V'}, eval("g:test_clip['+']"))
eq({{'secound line', ''}, 'V'}, eval("g:test_clip['*']")) eq({{'second line', ''}, 'V'}, eval("g:test_clip['*']"))
end) end)
it('handles null bytes when pasting and in getreg', function() it('handles null bytes when pasting and in getreg', function()
@@ -477,7 +477,7 @@ describe('clipboard (with fake clipboard.vim)', function()
expect("indeed star") expect("indeed star")
end) end)
it('unamed operations work even if the provider fails', function() it('unnamed operations work even if the provider fails', function()
insert('the text') insert('the text')
feed('yy') feed('yy')
feed_command("let g:cliperror = 1") feed_command("let g:cliperror = 1")
@@ -511,7 +511,7 @@ describe('clipboard (with fake clipboard.vim)', function()
eq('textstar', meths.get_current_line()) eq('textstar', meths.get_current_line())
end) end)
it('Block paste works currectly', function() it('Block paste works correctly', function()
insert([[ insert([[
aabbcc aabbcc
ddeeff ddeeff
@@ -559,7 +559,7 @@ describe('clipboard (with fake clipboard.vim)', function()
eq({{'really unnamed', ''}, 'V'}, eval("g:test_clip['+']")) eq({{'really unnamed', ''}, 'V'}, eval("g:test_clip['+']"))
eq({{'really unnamed', ''}, 'V'}, eval("g:test_clip['*']")) eq({{'really unnamed', ''}, 'V'}, eval("g:test_clip['*']"))
-- unnamedplus takes predecence when pasting -- unnamedplus takes precedence when pasting
eq('+', eval('v:register')) eq('+', eval('v:register'))
feed_command("let g:test_clip['+'] = ['the plus','']") feed_command("let g:test_clip['+'] = ['the plus','']")
feed_command("let g:test_clip['*'] = ['the star','']") feed_command("let g:test_clip['*'] = ['the star','']")

View File

@@ -762,7 +762,7 @@ describe('Buffer highlighting', function()
local s1 = {{'Köttbullar', 'Comment'}, {'Kräuterbutter'}} local s1 = {{'Köttbullar', 'Comment'}, {'Kräuterbutter'}}
local s2 = {{'こんにちは', 'Comment'}} local s2 = {{'こんにちは', 'Comment'}}
-- TODO: only a virtual text from the same ns curretly overrides -- TODO: only a virtual text from the same ns currently overrides
-- an existing virtual text. We might add a prioritation system. -- an existing virtual text. We might add a prioritation system.
set_virtual_text(id1, 0, s1, {}) set_virtual_text(id1, 0, s1, {})
eq({{1, 0, 0, { eq({{1, 0, 0, {

View File

@@ -569,7 +569,7 @@ describe('float window', function()
end) end)
end) end)
describe('with mulitple tabpages but only one listed buffer,', function() describe('with multiple tabpages but only one listed buffer,', function()
local float_opts = {relative = 'editor', row = 1, col = 1, width = 1, height = 1} local float_opts = {relative = 'editor', row = 1, col = 1, width = 1, height = 1}
local unlisted_buf, old_buf, old_win local unlisted_buf, old_buf, old_win
before_each(function() before_each(function()
@@ -2761,7 +2761,7 @@ describe('float window', function()
}, "NW", 2, 1, 32, true } }, "NW", 2, 1, 32, true }
}} }}
else else
-- note: appears misalinged due to cursor -- note: appears misaligned due to cursor
screen:expect{grid=[[ screen:expect{grid=[[
^example text that is wider than the window | ^example text that is wider than the window |
{1:some info! } | {1:some info! } |

View File

@@ -220,7 +220,7 @@ local setup_replace_cmd = [[
end end
-- ":<range>Replace <pat1> <pat2>" -- ":<range>Replace <pat1> <pat2>"
-- Replaces all occurences of <pat1> in <range> with <pat2> -- Replaces all occurrences of <pat1> in <range> with <pat2>
vim.api.nvim_create_user_command( vim.api.nvim_create_user_command(
'Replace', 'Replace',
replace, replace,

View File

@@ -194,7 +194,7 @@ end)
describe('UI can set terminal option', function() describe('UI can set terminal option', function()
local screen local screen
before_each(function() before_each(function()
-- by default we implicity "--cmd 'set bg=light'" which ruins everything -- by default we implicitly "--cmd 'set bg=light'" which ruins everything
clear{args_rm={'--cmd'}} clear{args_rm={'--cmd'}}
screen = Screen.new(20,5) screen = Screen.new(20,5)
end) end)

View File

@@ -519,7 +519,7 @@ function Screen:_wait(check, flags)
end end
assert(timeout >= minimal_timeout) assert(timeout >= minimal_timeout)
local did_miminal_timeout = false local did_minimal_timeout = false
local function notification_cb(method, args) local function notification_cb(method, args)
assert(method == 'redraw', string.format( assert(method == 'redraw', string.format(
@@ -536,7 +536,7 @@ function Screen:_wait(check, flags)
if not err then if not err then
success_seen = true success_seen = true
if did_miminal_timeout then if did_minimal_timeout then
self._session:stop() self._session:stop()
end end
elseif success_seen and #args > 0 then elseif success_seen and #args > 0 then
@@ -558,7 +558,7 @@ function Screen:_wait(check, flags)
end end
if not success_seen and not eof then if not success_seen and not eof then
did_miminal_timeout = true did_minimal_timeout = true
eof = run_session(self._session, flags.request_cb, notification_cb, nil, timeout-minimal_timeout) eof = run_session(self._session, flags.request_cb, notification_cb, nil, timeout-minimal_timeout)
end end

View File

@@ -8,7 +8,7 @@ local clear = helpers.clear
before_each(clear) before_each(clear)
describe('extend()', function() describe('extend()', function()
it('suceeds to extend list with itself', function() it('succeeds to extend list with itself', function()
meths.set_var('l', {1, {}}) meths.set_var('l', {1, {}})
eq({1, {}, 1, {}}, eval('extend(l, l)')) eq({1, {}, 1, {}}, eval('extend(l, l)'))
eq({1, {}, 1, {}}, meths.get_var('l')) eq({1, {}, 1, {}}, meths.get_var('l'))

View File

@@ -343,7 +343,7 @@ describe('json_decode() function', function()
exc_exec('call json_decode("\\t\\"abc\\\\u0000")')) exc_exec('call json_decode("\\t\\"abc\\\\u0000")'))
end) end)
it('fails to parse unknown escape sequnces', function() it('fails to parse unknown escape sequences', function()
eq('Vim(call):E474: Unknown escape sequence: \\a"', eq('Vim(call):E474: Unknown escape sequence: \\a"',
exc_exec('call json_decode("\\t\\"\\\\a\\"")')) exc_exec('call json_decode("\\t\\"\\\\a\\"")'))
end) end)