diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d906b949c..b650c5dd85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -171,7 +171,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup commom environment variables + - name: Setup common environment variables run: ./.github/workflows/env.sh ${{ matrix.flavor }} - name: Install apt packages diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index e73634c632..fcbbb6c4d8 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -45,7 +45,7 @@ start with a TCP/IP socket instead, use |--listen| with a TCP-style address: > More endpoints can be started with |serverstart()|. Note that localhost TCP sockets are generally less secure than named pipes, -and can lead to vunerabilities like remote code execution. +and can lead to vulnerabilities like remote code execution. Connecting to the socket is the easiest way a programmer can test the API, which can be done through any msgpack-rpc client library or full-featured @@ -198,7 +198,7 @@ any of these approaches: 2. Start Nvim with |--api-info|. Useful for statically-compiled clients. Example (requires Python "pyyaml" and "msgpack-python" modules): > - nvim --api-info | python -c 'import msgpack, sys, yaml; print yaml.dump(msgpack.unpackb(sys.stdin.read()))' + nvim --api-info | python -c 'import msgpack, sys, yaml; yaml.dump(msgpack.unpackb(sys.stdin.buffer.read()), sys.stdout)' < 3. Use the |api_info()| Vimscript function. > :lua print(vim.inspect(vim.fn.api_info())) @@ -468,7 +468,7 @@ extmark position and enter some text, the extmark migrates forward. > f o o z|b a r line (| = cursor) 4 extmark (after typing "z") -If an extmark is on the last index of a line and you inputsa newline at that +If an extmark is on the last index of a line and you inputs a newline at that point, the extmark will accordingly migrate to the next line: > f o o z b a r| line (| = cursor) @@ -674,7 +674,7 @@ nvim_add_user_command({name}, {command}, {*opts}) string options listed in |:command-complete|, the "complete" key also accepts a Lua function which works like the "customlist" completion - mode |:command-complete-customlist|. + mode |:command-completion-customlist|. nvim_call_atomic({calls}) *nvim_call_atomic()* Calls many API methods atomically. diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt index 5f376a600e..e14427494d 100644 --- a/runtime/doc/channel.txt +++ b/runtime/doc/channel.txt @@ -44,7 +44,7 @@ functions like |chansend()| consume channel ids. 2. Reading and writing raw bytes *channel-bytes* Channels opened by Vimscript functions operate with raw bytes by default. For -a job channel using RPC, bytes can still be read over its stderr. Similarily, +a job channel using RPC, bytes can still be read over its stderr. Similarly, only bytes can be written to Nvim's own stderr. *channel-callback* diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index 7127c74134..178b0dc62b 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -105,7 +105,7 @@ in eval.c: - eval_call_provider(name, method, arguments, discard): calls provider#{name}#Call with the method and arguments. If discard is true, any - value returned by the provider will be discarded and and empty value be + value returned by the provider will be discarded and empty value will be returned. - eval_has_provider(name): Checks the `g:loaded_{name}_provider` variable which must be set to 2 by the provider script to indicate that it is diff --git a/runtime/doc/lsp-extension.txt b/runtime/doc/lsp-extension.txt index d13303ada6..6e9ad940c7 100644 --- a/runtime/doc/lsp-extension.txt +++ b/runtime/doc/lsp-extension.txt @@ -60,7 +60,7 @@ The example will: return nil end local dir = bufname - -- Just in case our algo is buggy, don't infinite loop. + -- Just in case our algorithm is buggy, don't infinite loop. for _ = 1, 100 do local did_change dir, did_change = dirname(dir) diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 395aa54d50..4f76c7c7a6 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -274,7 +274,7 @@ arguments separated by " " (space) instead of "\t" (tab). lua << EOF local linenr = vim.api.nvim_win_get_cursor(0)[1] local curline = vim.api.nvim_buf_get_lines( - 0, linenr, linenr + 1, false)[1] + 0, linenr - 1, linenr, false)[1] print(string.format("Current line [%d] has %d bytes", linenr, #curline)) EOF diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 935d958729..62e13285f5 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -133,7 +133,7 @@ capabilities as if they had been in the terminfo definition. If terminfo does not (yet) have this flag, Nvim will fall back to $TERM and other environment variables. It will add constructed "setrgbf" and "setrgbb" -capabilities in the case of the the "rxvt", "linux", "st", "tmux", and "iterm" +capabilities in the case of the "rxvt", "linux", "st", "tmux", and "iterm" terminal types, or when Konsole, genuine Xterm, a libvte terminal emulator version 0.36 or later, or a terminal emulator that sets the COLORTERM environment variable to "truecolor" is detected. diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 5f238fb2ff..7de6a0f890 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -210,7 +210,7 @@ Here is a list of built-in predicates : < `match?` *ts-predicate-match?* `vim-match?` *ts-predicate-vim-match?* - This will match if the provived vim regex matches the text + This will match if the provided vim regex matches the text corresponding to a node : > ((identifier) @constant (#match? @constant "^[A-Z_]+$")) < Note: the `^` and `$` anchors will respectively match the diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index cfbabb12a6..72bda63b43 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -897,7 +897,7 @@ function lsp.start_client(config) client.initialized = true uninitialized_clients[client_id] = nil client.workspace_folders = workspace_folders - -- TODO(mjlbach): Backwards compatbility, to be removed in 0.7 + -- TODO(mjlbach): Backwards compatibility, to be removed in 0.7 client.workspaceFolders = client.workspace_folders client.server_capabilities = assert(result.capabilities, "initialize result doesn't contain capabilities") -- These are the cleaned up capabilities we use for dynamically deciding diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua index 8e3ed9b002..543fdb0237 100644 --- a/runtime/lua/vim/lsp/buf.lua +++ b/runtime/lua/vim/lsp/buf.lua @@ -453,7 +453,7 @@ end --- Send request to the server to resolve document highlights for the current --- text document position. This request can be triggered by a key mapping or ---- by events such as `CursorHold`, eg: +--- by events such as `CursorHold`, e.g.: --- ---
 --- autocmd CursorHold   lua vim.lsp.buf.document_highlight()
diff --git a/runtime/lua/vim/lsp/sync.lua b/runtime/lua/vim/lsp/sync.lua
index d01f45ad8f..0f4e5b572b 100644
--- a/runtime/lua/vim/lsp/sync.lua
+++ b/runtime/lua/vim/lsp/sync.lua
@@ -298,7 +298,7 @@ end
 
 ---@private
 -- rangelength depends on the offset encoding
--- bytes for utf-8 (clangd with extenion)
+-- bytes for utf-8 (clangd with extension)
 -- codepoints for utf-16
 -- codeunits for utf-32
 -- Line endings count here as 2 chars for \r\n (dos), 1 char for \n (unix), and 1 char for \r (mac)
diff --git a/runtime/lua/vim/treesitter/languagetree.lua b/runtime/lua/vim/treesitter/languagetree.lua
index 594765761d..85fd5cd8e0 100644
--- a/runtime/lua/vim/treesitter/languagetree.lua
+++ b/runtime/lua/vim/treesitter/languagetree.lua
@@ -77,7 +77,7 @@ end
 
 --- Determines whether this tree is valid.
 --- If the tree is invalid, `parse()` must be called
---- to get the an updated tree.
+--- to get the updated tree.
 function LanguageTree:is_valid()
   return self._valid
 end
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 693d2083e6..f8db4cce42 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -383,7 +383,7 @@ error:
 /// @param str        String to be converted.
 /// @param from_part  Legacy Vim parameter. Usually true.
 /// @param do_lt      Also translate . Ignored if `special` is false.
-/// @param special    Replace |keycodes|, e.g.  becomes a "\n" char.
+/// @param special    Replace |keycodes|, e.g.  becomes a "\r" char.
 /// @see replace_termcodes
 /// @see cpoptions
 String nvim_replace_termcodes(String str, Boolean from_part, Boolean do_lt, Boolean special)
@@ -1163,7 +1163,7 @@ static void term_close(void *data)
 /// Send data to channel `id`. For a job, it writes it to the
 /// stdin of the process. For the stdio channel |channel-stdio|,
 /// it writes to Nvim's stdout.  For an internal terminal instance
-/// (|nvim_open_term()|) it writes directly to terimal output.
+/// (|nvim_open_term()|) it writes directly to terminal output.
 /// See |channel-bytes| for more information.
 ///
 /// This function writes raw data, not RPC messages.  If the channel
@@ -2394,11 +2394,14 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error *
 ///                 - mods: (string) Command modifiers, if any ||
 /// @param  opts    Optional command attributes. See |command-attributes| for more details. To use
 ///                 boolean attributes (such as |:command-bang| or |:command-bar|) set the value to
-///                 "true". When using a Lua function for {command} you can also provide a "desc"
-///                 key that will be displayed when listing commands. In addition to the string
-///                 options listed in |:command-complete|, the "complete" key also accepts a Lua
-///                 function which works like the "customlist" completion mode
-///                 |:command-complete-customlist|.
+///                 "true". In addition to the string options listed in |:command-complete|, the
+///                 "complete" key also accepts a Lua function which works like the "customlist"
+///                 completion mode |:command-completion-customlist|.
+///
+///                 Additional parameters.
+///                 - desc: (string) Used for listing the command when a Lua function is used for
+///                                  {command}.
+///                 - force: (boolean) Override any previous definition.
 /// @param[out] err Error details, if any.
 void nvim_add_user_command(String name, Object command, Dict(user_command) *opts, Error *err)
   FUNC_API_SINCE(9)
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index 28b4eb9fe2..5133fe7ac8 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -411,7 +411,7 @@ return {
     },
     {
       full_name='compatible', abbreviation='cp',
-	  short_desc=N_("No description"),
+      short_desc=N_("No description"),
       type='bool', scope={'global'},
       redraw={'all_windows'},
       varname='p_force_off',
@@ -665,14 +665,14 @@ return {
     },
     {
       full_name='edcompatible', abbreviation='ed',
-	  short_desc=N_("No description"),
+      short_desc=N_("No description"),
       type='bool', scope={'global'},
       varname='p_force_off',
       defaults={if_true=false}
     },
     {
       full_name='emoji', abbreviation='emo',
-	  short_desc=N_("No description"),
+      short_desc=N_("No description"),
       type='bool', scope={'global'},
       redraw={'all_windows', 'ui_option'},
       varname='p_emoji',
@@ -1184,7 +1184,7 @@ return {
     },
     {
       full_name='inccommand', abbreviation='icm',
-	  short_desc=N_("Live preview of substitution"),
+      short_desc=N_("Live preview of substitution"),
       type='string', scope={'global'},
       redraw={'all_windows'},
       varname='p_icm',
@@ -2499,7 +2499,7 @@ return {
     },
     {
       full_name='termencoding', abbreviation='tenc',
-      short_desc=N_("Terminal encodig"),
+      short_desc=N_("Terminal encoding"),
       type='string', scope={'global'},
       defaults={if_true=""}
     },
@@ -2622,7 +2622,7 @@ return {
     },
     {
       full_name='ttyfast', abbreviation='tf',
-	  short_desc=N_("No description"),
+      short_desc=N_("No description"),
       type='bool', scope={'global'},
       no_mkrc=true,
       varname='p_force_on',
diff --git a/src/nvim/viml/parser/expressions.c b/src/nvim/viml/parser/expressions.c
index ba6cfab98b..8a14710351 100644
--- a/src/nvim/viml/parser/expressions.c
+++ b/src/nvim/viml/parser/expressions.c
@@ -1536,7 +1536,7 @@ static inline void east_set_error(const ParserState *const pstate, ExprASTError
     /* TODO(ZyX-I): Extend syntax to allow ${expr}. This is needed to */ \
     /* handle environment variables like those bash uses for */ \
     /* `export -f`: their names consist not only of alphanumeric */ \
-    /* characetrs. */ \
+    /* characters. */ \
     case kExprNodeComplexIdentifier: \
     case kExprNodePlainIdentifier: \
     case kExprNodeCurlyBracesIdentifier: { \
diff --git a/src/nvim/viml/parser/expressions.h b/src/nvim/viml/parser/expressions.h
index fe9327b27d..9d0bc9d468 100644
--- a/src/nvim/viml/parser/expressions.h
+++ b/src/nvim/viml/parser/expressions.h
@@ -57,7 +57,7 @@ typedef enum {
 } LexExprTokenType;
 
 typedef enum {
-  kExprCmpEqual,  ///< Equality, unequality.
+  kExprCmpEqual,  ///< Equality, inequality.
   kExprCmpMatches,  ///< Matches regex, not matches regex.
   kExprCmpGreater,  ///< `>` or `<=`
   kExprCmpGreaterOrEqual,  ///< `>=` or `<`.
diff --git a/test/unit/charset/vim_str2nr_spec.lua b/test/unit/charset/vim_str2nr_spec.lua
index 5fc3b83a13..caf330c378 100644
--- a/test/unit/charset/vim_str2nr_spec.lua
+++ b/test/unit/charset/vim_str2nr_spec.lua
@@ -463,7 +463,7 @@ describe('vim_str2nr()', function()
     test_vim_str2nr("1'2'3'4", flags, {len = 7, num = 1234, unum = 1234, pre = 0}, 0)
 
     -- counter-intuitive, but like Vim, strict=true should partially accept
-    -- these: (' and - are not alpha-numeric)
+    -- these: (' and - are not alphanumeric)
     test_vim_str2nr("7''331", flags, {len = 1, num = 7, unum = 7, pre = 0}, 0)
     test_vim_str2nr("123'x4", flags, {len = 3, num = 123, unum = 123, pre = 0}, 0)
     test_vim_str2nr("1337'", flags, {len = 4, num = 1337, unum = 1337, pre = 0}, 0)
diff --git a/test/unit/garray_spec.lua b/test/unit/garray_spec.lua
index 28df8a6e3f..5d41dd39ec 100644
--- a/test/unit/garray_spec.lua
+++ b/test/unit/garray_spec.lua
@@ -18,7 +18,7 @@ local growsize = 95
 -- constructing a class wrapper around garray. It could for example associate
 -- ga_clear_strings to the underlying garray cdata if the garray is a string
 -- array. But for now I estimate that that kind of magic might make testing
--- less "transparant" (i.e.: the interface would become quite different as to
+-- less "transparent" (i.e.: the interface would become quite different as to
 -- how one would use it from C.
 
 -- accessors
diff --git a/test/unit/os/env_spec.lua b/test/unit/os/env_spec.lua
index e7cb5e5d5e..a0e02b6624 100644
--- a/test/unit/os/env_spec.lua
+++ b/test/unit/os/env_spec.lua
@@ -191,7 +191,7 @@ describe('env.c', function()
 
       if ffi.abi('64bit') then
         -- couldn't use a bigger number because it gets converted to
-        -- double somewere, should be big enough anyway
+        -- double somewhere, should be big enough anyway
         -- maxuint64 = ffi.new 'size_t', 18446744073709551615
         local maxuint64 = ffi.new('size_t', 18446744073709000000)
         eq(NULL, cimp.os_getenvname_at_index(maxuint64))
diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua
index 7fd71cb1ae..0bb33772cd 100644
--- a/test/unit/os/fs_spec.lua
+++ b/test/unit/os/fs_spec.lua
@@ -1029,7 +1029,7 @@ describe('fs.c', function()
       itp('returns the correct blocksize of a file', function()
         local path = 'unit-test-directory/test.file'
         -- there is a bug in luafilesystem where
-        -- `lfs.attributes path, 'blksize'` returns the worng value:
+        -- `lfs.attributes path, 'blksize'` returns the wrong value:
         -- https://github.com/keplerproject/luafilesystem/pull/44
         -- using this workaround for now:
         local blksize = lfs.attributes(path).blksize
@@ -1038,7 +1038,7 @@ describe('fs.c', function()
         if blksize then
           eq(blksize, fs.os_fileinfo_blocksize(info))
         else
-          -- luafs dosn't support blksize on windows
+          -- luafs doesn't support blksize on windows
           -- libuv on windows returns a constant value as blocksize
           -- checking for this constant value should be enough
           eq(2048, fs.os_fileinfo_blocksize(info))