diff options
43 files changed, 176 insertions, 149 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 7b4dce3441..e6523aa215 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -523,7 +523,7 @@ function! s:check_virtualenv() abort let hint = '$PATH ambiguities in subshells typically are ' \.'caused by your shell config overriding the $PATH previously set by the ' \.'virtualenv. Either prevent them from doing so, or use this workaround: ' - \.'https://vi.stackexchange.com/a/7654' + \.'https://vi.stackexchange.com/a/34996' let hints[hint] = v:true endif endfor diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 13b7c2f61a..efffca72ad 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -361,7 +361,7 @@ UTF-32 and UTF-16 sizes of the deleted region is also passed as additional arguments {old_utf32_size} and {old_utf16_size}. "on_changedtick" is invoked when |b:changedtick| was incremented but no text -was changed. The parameters recieved are ("changedtick", {buf}, {changedtick}). +was changed. The parameters received are ("changedtick", {buf}, {changedtick}). *api-lua-detach* In-process Lua callbacks can detach by returning `true`. This will detach all @@ -684,7 +684,7 @@ nvim_call_atomic({calls}) *nvim_call_atomic()* atomically, i.e. without interleaving redraws, RPC requests from other clients, or user interactions (however API methods may trigger autocommands or event processing which - have such side-effects, e.g. |:sleep| may wake timers). + have such side effects, e.g. |:sleep| may wake timers). 2. To minimize RPC overhead (roundtrips) of a sequence of many requests. @@ -748,7 +748,7 @@ nvim_del_keymap({mode}, {lhs}) *nvim_del_keymap()* |nvim_set_keymap()| nvim_del_mark({name}) *nvim_del_mark()* - Deletes a uppercase/file named mark. See |mark-motions|. + Deletes an uppercase/file named mark. See |mark-motions|. Note: fails with error if a lowercase or buffer local named mark @@ -1117,7 +1117,7 @@ nvim_get_option_value({name}, {*opts}) *nvim_get_option_value()* Parameters: ~ {name} Option name {opts} Optional parameters - • scope: One of 'global' or 'local'. Analagous to + • scope: One of 'global' or 'local'. Analogous to |:setglobal| and |:setlocal|, respectively. Return: ~ @@ -1601,7 +1601,7 @@ nvim_set_option_value({name}, {value}, {*opts}) {name} Option name {value} New option value {opts} Optional parameters - • scope: One of 'global' or 'local'. Analagous to + • scope: One of 'global' or 'local'. Analogous to |:setglobal| and |:setlocal|, respectively. nvim_set_var({name}, {value}) *nvim_set_var()* @@ -2765,7 +2765,7 @@ nvim_win_is_valid({window}) *nvim_win_is_valid()* true if the window is valid, false otherwise nvim_win_set_buf({window}, {buffer}) *nvim_win_set_buf()* - Sets the current buffer in a window, without side-effects + Sets the current buffer in a window, without side effects Attributes: ~ not allowed when |textlock| is active diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index a825435179..bb36fa46f6 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -132,7 +132,7 @@ with |vim.notify()|: > In this example, there is nothing to do when diagnostics are hidden, so we omit the "hide" function. -Existing handlers can be overriden. For example, use the following to only +Existing handlers can be overridden. For example, use the following to only show a sign for the highest severity diagnostic on a given line: > -- Create a custom namespace. This will aggregate signs from all other @@ -177,8 +177,9 @@ All highlights defined for diagnostics begin with `Diagnostic` followed by the type of highlight (e.g., `Sign`, `Underline`, etc.) and the severity (e.g. `Error`, `Warn`, etc.) -Sign, underline and virtual text highlights (by default) are linked to their -corresponding default highlight. +By default, highlights for signs, floating windows, and virtual text are linked to the +corresponding default highlight. Underline highlights are not linked and use their +own default highlight groups. For example, the default highlighting for |hl-DiagnosticSignError| is linked to |hl-DiagnosticError|. To change the default (and therefore the linked @@ -298,7 +299,6 @@ Example: > autocmd DiagnosticChanged * lua vim.diagnostic.setqflist({open = false }) < ============================================================================== -============================================================================== Lua module: vim.diagnostic *diagnostic-api* config({opts}, {namespace}) *vim.diagnostic.config()* @@ -343,7 +343,10 @@ config({opts}, {namespace}) *vim.diagnostic.config()* |diagnostic-severity| • virtual_text: (default true) Use virtual - text for diagnostics. Options: + text for diagnostics. If multiple + diagnostics are set for a namespace, one + prefix per diagnostic + the last diagnostic + message are shown. Options: • severity: Only show virtual text for diagnostics matching the given severity |diagnostic-severity| @@ -353,6 +356,11 @@ config({opts}, {namespace}) *vim.diagnostic.config()* is more than one diagnostic source in the buffer. Otherwise, any truthy value means to always show the diagnostic source. + • spacing: (number) Amount of empty spaces + inserted at the beginning of the virtual + text. + • prefix: (string) Prepend diagnostic + message with prefix. • format: (function) A function that takes a diagnostic as input and returns a string. The return value is the text used diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 63f6c5628a..c2158f3a1e 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2278,7 +2278,7 @@ USAGE RESULT DESCRIPTION ~ abs({expr}) Float or Number absolute value of {expr} acos({expr}) Float arc cosine of {expr} add({object}, {item}) List/Blob append {item} to {object} -and({expr}, {expr}) Number bitwise AND +and({expr}, {expr}) Number bitwise AND api_info() Dict api metadata append({lnum}, {string}) Number append {string} below line {lnum} append({lnum}, {list}) Number append lines {list} below line {lnum} @@ -2310,7 +2310,7 @@ assert_notmatch({pat}, {text} [, {msg}]) assert_report({msg}) Number report a test failure assert_true({actual} [, {msg}]) Number assert {actual} is true atan({expr}) Float arc tangent of {expr} -atan2({expr}, {expr}) Float arc tangent of {expr1} / {expr2} +atan2({expr}, {expr}) Float arc tangent of {expr1} / {expr2} browse({save}, {title}, {initdir}, {default}) String put up a file requester browsedir({title}, {initdir}) String put up a directory requester @@ -2336,7 +2336,7 @@ char2nr({expr}[, {utf8}]) Number ASCII/UTF-8 value of first char in {expr} charidx({string}, {idx} [, {countcc}]) Number char index of byte {idx} in {string} chdir({dir}) String change current working directory -cindent({lnum}) Number C indent for line {lnum} +cindent({lnum}) Number C indent for line {lnum} clearmatches([{win}]) none clear all matches col({expr}) Number column nr of cursor or mark complete({startcol}, {matches}) none set Insert mode completion @@ -2349,7 +2349,7 @@ copy({expr}) any make a shallow copy of {expr} cos({expr}) Float cosine of {expr} cosh({expr}) Float hyperbolic cosine of {expr} count({list}, {expr} [, {ic} [, {start}]]) - Number count how many {expr} are in {list} + Number count how many {expr} are in {list} cscope_connection([{num}, {dbpath} [, {prepend}]]) Number checks existence of cscope connection ctxget([{index}]) Dict return the |context| dict at {index} @@ -2362,7 +2362,7 @@ ctxsize() Number return |context-stack| size cursor({lnum}, {col} [, {off}]) Number move cursor to {lnum}, {col}, {off} cursor({list}) Number move cursor to position in {list} -debugbreak({pid}) Number interrupt process being debugged +debugbreak({pid}) Number interrupt process being debugged deepcopy({expr} [, {noref}]) any make a full copy of {expr} delete({fname} [, {flags}]) Number delete the file or directory {fname} deletebufline({buf}, {first}[, {last}]) @@ -2381,7 +2381,7 @@ eval({string}) any evaluate {string} into its value eventhandler() Number |TRUE| if inside an event handler executable({expr}) Number 1 if executable {expr} exists execute({command}) String execute and capture output of {command} -exepath({expr}) String full path of the command {expr} +exepath({expr}) String full path of the command {expr} exists({expr}) Number |TRUE| if {expr} exists extend({expr1}, {expr2} [, {expr3}]) List/Dict insert items of {expr2} into {expr1} @@ -2502,11 +2502,11 @@ inputlist({textlist}) Number let the user pick from a choice list inputrestore() Number restore typeahead inputsave() Number save and clear typeahead inputsecret({prompt} [, {text}]) - String like input() but hiding the text + String like input() but hiding the text insert({object}, {item} [, {idx}]) List insert {item} in {object} [before {idx}] interrupt() none interrupt script execution -invert({expr}) Number bitwise invert +invert({expr}) Number bitwise invert isdirectory({directory}) Number |TRUE| if {directory} is a directory isinf({expr}) Number determine if {expr} is infinity value (positive or negative) @@ -2526,7 +2526,7 @@ json_encode({expr}) String Convert {expr} to JSON keys({dict}) List keys in {dict} len({expr}) Number the length of {expr} libcall({lib}, {func}, {arg}) String call {func} in library {lib} with {arg} -libcallnr({lib}, {func}, {arg}) Number idem, but return a Number +libcallnr({lib}, {func}, {arg}) Number idem, but return a Number line({expr} [, {winid}]) Number line nr of cursor, last line or mark line2byte({lnum}) Number byte count of line {lnum} lispindent({lnum}) Number Lisp indent for line {lnum} @@ -2568,7 +2568,7 @@ msgpackparse({data}) List parse msgpack to a list of objects nextnonblank({lnum}) Number line nr of non-blank line >= {lnum} nr2char({expr}[, {utf8}]) String single char with ASCII/UTF-8 value {expr} nvim_...({args}...) any call nvim |api| functions -or({expr}, {expr}) Number bitwise OR +or({expr}, {expr}) Number bitwise OR pathshorten({expr}) String shorten directory names in a path perleval({expr}) any evaluate |perl| expression pow({x}, {y}) Float {x} to the power of {y} @@ -2628,7 +2628,7 @@ screenrow() Number current cursor row screenstring({row}, {col}) String characters at screen position search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) Number search for {pattern} -searchcount([{options}]) Dict Get or update the last search count +searchcount([{options}]) Dict Get or update the last search count searchdecl({name} [, {global} [, {thisblock}]]) Number search for variable declaration searchpair({start}, {middle}, {end} [, {flags} [, {skip} [...]]]) @@ -2700,7 +2700,7 @@ split({expr} [, {pat} [, {keepempty}]]) List make |List| from {pat} separated {expr} sqrt({expr}) Float square root of {expr} stdioopen({dict}) Number open stdio in a headless instance. -stdpath({what}) String/List returns the standard path(s) for {what} +stdpath({what}) String/List returns the standard path(s) for {what} str2float({expr} [, {quoted}]) Float convert String to Float str2list({expr} [, {utf8}]) List convert each character of {expr} to ASCII/UTF-8 value @@ -2736,7 +2736,7 @@ synID({lnum}, {col}, {trans}) Number syntax ID at {lnum} and {col} synIDattr({synID}, {what} [, {mode}]) String attribute {what} of syntax ID {synID} synIDtrans({synID}) Number translated syntax ID of {synID} -synconcealed({lnum}, {col}) List info about concealing +synconcealed({lnum}, {col}) List info about concealing synstack({lnum}, {col}) List stack of syntax IDs at {lnum} and {col} system({cmd} [, {input}]) String output of shell command/filter {cmd} systemlist({cmd} [, {input}]) List output of shell command/filter {cmd} @@ -2772,7 +2772,7 @@ values({dict}) List values in {dict} virtcol({expr}) Number screen column of cursor or mark visualmode([expr]) String last visual mode used wait({timeout}, {condition}[, {interval}]) - Number Wait until {condition} is satisfied + Number Wait until {condition} is satisfied wildmenumode() Number whether 'wildmenu' mode is active win_execute({id}, {command} [, {silent}]) String execute {command} in window {id} diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index a3929aeab9..614dd82443 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -214,7 +214,7 @@ For |lsp-request|, each |lsp-handler| has this signature: > request, a table with information about the error is sent. Otherwise, it is `nil`. See |lsp-response|. {result} (Result | Params | nil) - When the language server is able to succesfully + When the language server is able to successfully complete a request, this contains the `result` key of the response. See |lsp-response|. {ctx} (table) @@ -236,7 +236,7 @@ For |lsp-request|, each |lsp-handler| has this signature: > {config} (table) Configuration for the handler. - Each handler can define it's own configuration + Each handler can define its own configuration table that allows users to customize the behavior of a particular handler. @@ -274,7 +274,7 @@ For |lsp-notification|, each |lsp-handler| has this signature: > {config} (table) Configuration for the handler. - Each handler can define it's own configuration + Each handler can define its own configuration table that allows users to customize the behavior of a particular handler. @@ -369,7 +369,7 @@ Handlers can be set by: For example: > vim.lsp.start_client { - ..., -- Other configuration ommitted. + ..., -- Other configuration omitted. handlers = { ["textDocument/definition"] = my_custom_server_definition }, @@ -394,6 +394,9 @@ in the following order: 2. Handler defined in |vim.lsp.start_client()|, if any. 3. Handler defined in |vim.lsp.handlers|, if any. + *vim.lsp.log_levels* +Log levels are defined in |vim.log.levels| + VIM.LSP.PROTOCOL *vim.lsp.protocol* @@ -444,7 +447,7 @@ LspCodeLens |nvim_buf_set_extmark()|. LspCodeLensSeparator *hl-LspCodeLensSeparator* - Used to color the seperator between two or more code lens. + Used to color the separator between two or more code lens. *lsp-highlight-signature* @@ -835,10 +838,10 @@ start_client({config}) *vim.lsp.start_client()* throws an error. `code` is a number describing the error. Other arguments may be passed depending on the error - kind. See |vim.lsp.client_errors| for - possible errors. Use - `vim.lsp.client_errors[code]` to get - human-friendly name. + kind. See |vim.lsp.rpc.client_errors| + for possible errors. Use + `vim.lsp.rpc.client_errors[code]` to + get human-friendly name. {before_init} Callback with parameters (initialize_params, config) invoked before the LSP "initialize" phase, @@ -1301,7 +1304,7 @@ hover({_}, {result}, {ctx}, {config}) *vim.lsp.handlers.hover()* {config} table Configuration table. • border: (default=nil) • Add borders to the floating window - • See |vim.api.nvim_open_win()| + • See |nvim_open_win()| *vim.lsp.handlers.signature_help()* signature_help({_}, {result}, {ctx}, {config}) diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 97062e5986..036454702b 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -791,9 +791,9 @@ vim.stricmp({a}, {b}) *vim.stricmp()* respectively. vim.str_utfindex({str}[, {index}]) *vim.str_utfindex()* - Convert byte index to UTF-32 and UTF-16 indicies. If {index} is not - supplied, the length of the string is used. All indicies are zero-based. - Returns two values: the UTF-32 and UTF-16 indicies respectively. + Convert byte index to UTF-32 and UTF-16 indices. If {index} is not + supplied, the length of the string is used. All indices are zero-based. + Returns two values: the UTF-32 and UTF-16 indices respectively. Embedded NUL bytes are treated as terminating the string. Invalid UTF-8 bytes, and embedded surrogates are counted as one code @@ -913,6 +913,15 @@ vim.types *vim.types* `vim.types.dictionary` will not change or that `vim.types` table will only contain values for these three types. + *log_levels* *vim.log.levels* +Log levels are one of the values defined in `vim.log.levels`: + + vim.log.levels.DEBUG + vim.log.levels.ERROR + vim.log.levels.INFO + vim.log.levels.TRACE + vim.log.levels.WARN + ------------------------------------------------------------------------------ LUA-VIMSCRIPT BRIDGE *lua-vimscript* diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt index e1ae138d90..bfacbe19f5 100644 --- a/runtime/doc/nvim_terminal_emulator.txt +++ b/runtime/doc/nvim_terminal_emulator.txt @@ -90,7 +90,7 @@ Mouse input has the following behavior: - If another window is clicked, terminal focus will be lost and nvim will jump to the clicked window - If the mouse wheel is used while the mouse is positioned in another window, - the terminal wont lose focus and the hovered window will be scrolled. + the terminal won't lose focus and the hovered window will be scrolled. ============================================================================== Configuration *terminal-config* @@ -428,7 +428,7 @@ When 'background' is "dark": hi debugBreakpoint term=reverse ctermbg=red guibg=red -Shorcuts *termdebug_shortcuts* +Shortcuts *termdebug_shortcuts* You can define your own shortcuts (mappings) to control gdb, that can work in any window, using the TermDebugSendCommand() function. Example: > diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 8f7241dd46..5f238fb2ff 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -100,7 +100,7 @@ tsnode:prev_named_sibling() *tsnode:prev_named_sibling()* tsnode:iter_children() *tsnode:iter_children()* Iterates over all the direct children of {tsnode}, regardless of - wether they are named or not. + whether they are named or not. Returns the child node plus the eventual field name corresponding to this child node. @@ -155,9 +155,9 @@ tsnode:sexpr() *tsnode:sexpr()* Get an S-expression representing the node as a string. tsnode:id() *tsnode:id()* - Get an unique identier for the node inside its own tree. + Get an unique identifier for the node inside its own tree. - No guarantees are made about this identifer's internal representation, + No guarantees are made about this identifier's internal representation, except for being a primitive lua type with value equality (so not a table). Presently it is a (non-printable) string. @@ -195,7 +195,7 @@ to a match. Treesitter Query Predicates *lua-treesitter-predicates* When writing queries for treesitter, one might use `predicates`, that is, -special scheme nodes that are evaluted to verify things on a captured node for +special scheme nodes that are evaluated to verify things on a captured node for example, the |eq?| predicate : > ((identifier) @foo (#eq? @foo "foo")) @@ -203,7 +203,7 @@ This will only match identifier corresponding to the `"foo"` text. Here is a list of built-in predicates : `eq?` *ts-predicate-eq?* - This predicate will check text correspondance between nodes or + This predicate will check text correspondence between nodes or strings : > ((identifier) @foo (#eq? @foo "foo")) ((node1) @left (node2) @right (#eq? @left @right)) @@ -212,7 +212,7 @@ Here is a list of built-in predicates : `vim-match?` *ts-predicate-vim-match?* This will match if the provived vim regex matches the text corresponding to a node : > - ((idenfitier) @constant (#match? @constant "^[A-Z_]+$")) + ((identifier) @constant (#match? @constant "^[A-Z_]+$")) < Note: the `^` and `$` anchors will respectively match the start and end of the node's text. @@ -267,7 +267,7 @@ Here is a list of built-in directives: `offset!` *ts-predicate-offset!* Takes the range of the captured node and applies the offsets to it's range : > - ((idenfitier) @constant (#offset! @constant 0 1 0 -1)) + ((identifier) @constant (#offset! @constant 0 1 0 -1)) < This will generate a range object for the captured node with the offsets applied. The arguments are `({capture_id}, {start_row}, {start_col}, {end_row}, {end_col}, {key?})` diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 42f1ee219b..104836862f 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2021 Dec 22 +" Last Change: 2021 Dec 27 " Listen very carefully, I will say this only once if exists("did_load_filetypes") diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 742ebf69b2..ddcead6ec5 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -556,13 +556,19 @@ end --- - underline: (default true) Use underline for diagnostics. Options: --- * severity: Only underline diagnostics matching the given severity --- |diagnostic-severity| ---- - virtual_text: (default true) Use virtual text for diagnostics. Options: +--- - virtual_text: (default true) Use virtual text for diagnostics. If multiple diagnostics +--- are set for a namespace, one prefix per diagnostic + the last diagnostic +--- message are shown. +--- Options: --- * severity: Only show virtual text for diagnostics matching the given --- severity |diagnostic-severity| --- * source: (boolean or string) Include the diagnostic source in virtual --- text. Use "if_many" to only show sources if there is more than --- one diagnostic source in the buffer. Otherwise, any truthy value --- means to always show the diagnostic source. +--- * spacing: (number) Amount of empty spaces inserted at the beginning +--- of the virtual text. +--- * prefix: (string) Prepend diagnostic message with prefix. --- * format: (function) A function that takes a diagnostic as input and --- returns a string. The return value is the text used to display --- the diagnostic. Example: diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 00839ec181..8bb9960a1b 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -290,7 +290,7 @@ end --- Memoizes a function. On first run, the function return value is saved and --- immediately returned on subsequent runs. If the function returns a multival, --- only the first returned value will be memoized and returned. The function will only be run once, ---- even if it has side-effects. +--- even if it has side effects. --- ---@param fn (function) Function to run ---@returns (function) Memoized function @@ -645,8 +645,8 @@ end ---@param on_error Callback with parameters (code, ...), invoked --- when the client operation throws an error. `code` is a number describing --- the error. Other arguments may be passed depending on the error kind. See ---- |vim.lsp.client_errors| for possible errors. ---- Use `vim.lsp.client_errors[code]` to get human-friendly name. +--- |vim.lsp.rpc.client_errors| for possible errors. +--- Use `vim.lsp.rpc.client_errors[code]` to get human-friendly name. --- ---@param before_init Callback with parameters (initialize_params, config) --- invoked before the LSP "initialize" phase, where `params` contains the @@ -757,8 +757,8 @@ function lsp.start_client(config) --- ---@param code (number) Error code ---@param err (...) Other arguments may be passed depending on the error kind - ---@see |vim.lsp.client_errors| for possible errors. Use - ---`vim.lsp.client_errors[code]` to get a human-friendly name. + ---@see |vim.lsp.rpc.client_errors| for possible errors. Use + ---`vim.lsp.rpc.client_errors[code]` to get a human-friendly name. function dispatch.on_error(code, err) local _ = log.error() and log.error(log_prefix, "on_error", { code = lsp.client_errors[code], err = err }) err_message(log_prefix, ': Error ', lsp.client_errors[code], ': ', vim.inspect(err)) @@ -1708,14 +1708,14 @@ end -- -- Can be used to lookup the number from the name or the -- name from the number. --- Levels by name: "trace", "debug", "info", "warn", "error" --- Level numbers begin with "trace" at 0 +-- Levels by name: "TRACE", "DEBUG", "INFO", "WARN", "ERROR" +-- Level numbers begin with "TRACE" at 0 lsp.log_levels = log.levels --- Sets the global log level for LSP logging. --- ---- Levels by name: "trace", "debug", "info", "warn", "error" ---- Level numbers begin with "trace" at 0 +--- Levels by name: "TRACE", "DEBUG", "INFO", "WARN", "ERROR" +--- Level numbers begin with "TRACE" at 0 --- --- Use `lsp.log_levels` for reverse lookup. --- diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua index c974d1a6b4..a1d3b2aa94 100644 --- a/runtime/lua/vim/lsp/handlers.lua +++ b/runtime/lua/vim/lsp/handlers.lua @@ -246,7 +246,7 @@ end ---@param config table Configuration table. --- - border: (default=nil) --- - Add borders to the floating window ---- - See |vim.api.nvim_open_win()| +--- - See |nvim_open_win()| function M.hover(_, result, ctx, config) config = config or {} config.focus_id = ctx.method diff --git a/runtime/lua/vim/lsp/log.lua b/runtime/lua/vim/lsp/log.lua index dbc473b52c..e0b5653587 100644 --- a/runtime/lua/vim/lsp/log.lua +++ b/runtime/lua/vim/lsp/log.lua @@ -8,8 +8,8 @@ local log = {} -- Log level dictionary with reverse lookup as well. -- -- Can be used to lookup the number from the name or the name from the number. --- Levels by name: 'trace', 'debug', 'info', 'warn', 'error' --- Level numbers begin with 'trace' at 0 +-- Levels by name: "TRACE", "DEBUG", "INFO", "WARN", "ERROR" +-- Level numbers begin with "TRACE" at 0 log.levels = vim.deepcopy(vim.log.levels) -- Default log level is warn. diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua index 1fb75ddeb7..1ecac50df4 100644 --- a/runtime/lua/vim/lsp/rpc.lua +++ b/runtime/lua/vim/lsp/rpc.lua @@ -133,7 +133,8 @@ local function request_parser_loop() end end -local client_errors = vim.tbl_add_reverse_lookup { +--- Mapping of error codes used by the client +local client_errors = { INVALID_SERVER_MESSAGE = 1; INVALID_SERVER_JSON = 2; NO_RESULT_CALLBACK_FOUND = 3; @@ -143,6 +144,8 @@ local client_errors = vim.tbl_add_reverse_lookup { SERVER_RESULT_CALLBACK_ERROR = 7; } +client_errors = vim.tbl_add_reverse_lookup(client_errors) + --- Constructs an error message from an LSP error object. --- ---@param err (table) The error object diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index ac979d0064..dfc606f927 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -662,7 +662,7 @@ Object nvim_get_option(String name, Error *err) /// /// @param name Option name /// @param opts Optional parameters -/// - scope: One of 'global' or 'local'. Analagous to +/// - scope: One of 'global' or 'local'. Analogous to /// |:setglobal| and |:setlocal|, respectively. /// @param[out] err Error details, if any /// @return Option value @@ -724,7 +724,7 @@ end: /// @param name Option name /// @param value New option value /// @param opts Optional parameters -/// - scope: One of 'global' or 'local'. Analagous to +/// - scope: One of 'global' or 'local'. Analogous to /// |:setglobal| and |:setlocal|, respectively. /// @param[out] err Error details, if any void nvim_set_option_value(String name, Object value, Dict(option) *opts, Error *err) @@ -1741,7 +1741,7 @@ Array nvim_list_chans(void) /// 1. To perform several requests from an async context atomically, i.e. /// without interleaving redraws, RPC requests from other clients, or user /// interactions (however API methods may trigger autocommands or event -/// processing which have such side-effects, e.g. |:sleep| may wake timers). +/// processing which have such side effects, e.g. |:sleep| may wake timers). /// 2. To minimize RPC overhead (roundtrips) of a sequence of many requests. /// /// @param channel_id @@ -2101,7 +2101,7 @@ void nvim__screenshot(String path) } -/// Deletes a uppercase/file named mark. See |mark-motions|. +/// Deletes an uppercase/file named mark. See |mark-motions|. /// /// @note fails with error if a lowercase or buffer local named mark is used. /// @param name Mark name diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index 6e68c057dc..907306da7b 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -39,7 +39,7 @@ Buffer nvim_win_get_buf(Window window, Error *err) return win->w_buffer->handle; } -/// Sets the current buffer in a window, without side-effects +/// Sets the current buffer in a window, without side effects /// /// @param window Window handle, or 0 for current window /// @param buffer Buffer handle diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 89baea83f8..abd22fba26 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -4576,7 +4576,7 @@ int build_stl_str_hl(win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use cur_tab_rec->def.func = NULL; } - // When inside update_screen we do not want redrawing a stausline, ruler, + // When inside update_screen we do not want redrawing a statusline, ruler, // title, etc. to trigger another redraw, it may cause an endless loop. if (updating_screen) { must_redraw = save_must_redraw; diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 0233b3a5ab..4f4da7c2a9 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -37,8 +37,8 @@ #include "nvim/path.h" #include "nvim/screen.h" #include "nvim/strings.h" -#include "nvim/undo.h" #include "nvim/ui.h" +#include "nvim/undo.h" #include "nvim/vim.h" #include "nvim/window.h" #include "xdiff/xdiff.h" @@ -674,11 +674,11 @@ void diff_redraw(bool dofold) } if (wp_other != NULL && curwin->w_p_scb) { if (used_max_fill_curwin) { - // The current window was set to used the maximum number of filler + // The current window was set to use the maximum number of filler // lines, may need to reduce them. diff_set_topline(wp_other, curwin); } else if (used_max_fill_other) { - // The other window was set to used the maximum number of filler + // The other window was set to use the maximum number of filler // lines, may need to reduce them. diff_set_topline(curwin, wp_other); } @@ -1508,7 +1508,7 @@ void ex_diffoff(exarg_T *eap) diff_clear(curtab); } - // Remove "hor" from from 'scrollopt' if there are no diff windows left. + // Remove "hor" from 'scrollopt' if there are no diff windows left. if (!diffwin && (vim_strchr(p_sbo, 'h') != NULL)) { do_cmdline_cmd("set sbo-=hor"); } diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 2e3eec3642..3517b3244e 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -1600,8 +1600,8 @@ static void ins_ctrl_v(void) */ static int pc_status; #define PC_STATUS_UNSET 0 // pc_bytes was not set -#define PC_STATUS_RIGHT 1 // right halve of double-wide char -#define PC_STATUS_LEFT 2 // left halve of double-wide char +#define PC_STATUS_RIGHT 1 // right half of double-wide char +#define PC_STATUS_LEFT 2 // left half of double-wide char #define PC_STATUS_SET 3 // pc_bytes was filled static char_u pc_bytes[MB_MAXBYTES + 1]; // saved bytes static int pc_attr; diff --git a/src/nvim/event/loop.c b/src/nvim/event/loop.c index 892c46dd04..89fced59c5 100644 --- a/src/nvim/event/loop.c +++ b/src/nvim/event/loop.c @@ -75,7 +75,7 @@ bool loop_poll_events(Loop *loop, int ms) /// @note Event is queued into `fast_events`, which is processed outside of the /// primary `events` queue by loop_poll_events(). For `main_loop`, that /// means `fast_events` is NOT processed in an "editor mode" -/// (VimState.execute), so redraw and other side-effects are likely to be +/// (VimState.execute), so redraw and other side effects are likely to be /// skipped. /// @see loop_schedule_deferred void loop_schedule_fast(Loop *loop, Event event) diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 4965eb9c20..cc5ab1b554 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -3025,7 +3025,7 @@ void ex_append(exarg_T *eap) // "start" is set to eap->line2+1 unless that position is invalid (when // eap->line2 pointed to the end of the buffer and nothing was appended) // "end" is set to lnum when something has been appended, otherwise - // it is the same than "start" -- Acevedo + // it is the same as "start" -- Acevedo curbuf->b_op_start.lnum = (eap->line2 < curbuf->b_ml.ml_line_count) ? eap->line2 + 1 : curbuf->b_ml.ml_line_count; if (eap->cmdidx != CMD_append) { diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 33f9477608..2e8d39ec30 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -2162,7 +2162,7 @@ int do_source(char *fname, int check_other, int is_vimrc) funccal_entry_T funccalp_entry; save_funccal(&funccalp_entry); - // Check if this script was sourced before to finds its SID. + // Check if this script was sourced before to find its SID. // If it's new, generate a new SID. // Always use a new sequence number. const sctx_T save_current_sctx = current_sctx; diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 7bf4a4a65a..0d82406a0a 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -67,8 +67,8 @@ #include "nvim/sign.h" #include "nvim/spell.h" #include "nvim/spellfile.h" -#include "nvim/strings.h" #include "nvim/state.h" +#include "nvim/strings.h" #include "nvim/syntax.h" #include "nvim/tag.h" #include "nvim/terminal.h" @@ -7495,9 +7495,8 @@ void do_exedit(exarg_T *eap, win_T *old_curwin) if ((eap->cmdidx == CMD_new || eap->cmdidx == CMD_tabnew || eap->cmdidx == CMD_tabedit - || eap->cmdidx == CMD_vnew - ) && *eap->arg == NUL) { - // ":new" or ":tabnew" without argument: edit an new empty buffer + || eap->cmdidx == CMD_vnew) && *eap->arg == NUL) { + // ":new" or ":tabnew" without argument: edit a new empty buffer setpcmark(); (void)do_ecmd(0, NULL, NULL, eap, ECMD_ONE, ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0), @@ -7851,7 +7850,7 @@ bool changedir_func(char_u *new_dir, CdScope scope) } bool dir_differs = new_dir == NULL || pdir == NULL - || pathcmp((char *)pdir, (char *)new_dir, -1) != 0; + || pathcmp((char *)pdir, (char *)new_dir, -1) != 0; if (new_dir != NULL && (!dir_differs || vim_chdir(new_dir) == 0)) { post_chdir(scope, dir_differs); retval = true; diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 1884dd49c5..b2cd5c510b 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -607,7 +607,7 @@ char_u *vim_findfile(void *search_ctx_arg) for (;;) { // downward search loop for (;;) { - // check if user user wants to stop the search + // check if user wants to stop the search os_breakcheck(); if (got_int) { break; @@ -1139,7 +1139,7 @@ static int ff_check_visited(ff_visited_T **visited_list, char_u *fname, char_u * bool url = false; FileID file_id; - // For an URL we only compare the name, otherwise we compare the + // For a URL we only compare the name, otherwise we compare the // device/inode. if (path_with_url((char *)fname)) { STRLCPY(ff_expand_buffer, fname, MAXPATHL); diff --git a/src/nvim/fold.c b/src/nvim/fold.c index b1d4321d4c..546345eeac 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -2332,7 +2332,7 @@ static linenr_T foldUpdateIEMSRecurse(garray_T *const gap, const int level, * firstlnum. */ while (!got_int) { - // set concat to 1 if it's allowed to concatenated this fold + // set concat to 1 if it's allowed to concatenate this fold // with a previous one that touches it. if (flp->start != 0 || flp->had_end <= MAX_LEVEL) { concat = 0; diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 6b1150cefa..424bf758e2 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -146,7 +146,7 @@ static int KeyNoremap = 0; // remapping flags // typebuf.tb_buf has three parts: room in front (for result of mappings), the // middle for typeahead and room for new characters (which needs to be 3 * -// MAXMAPLEN) for the Amiga). +// MAXMAPLEN for the Amiga). #define TYPELEN_INIT (5 * (MAXMAPLEN + 3)) static char_u typebuf_init[TYPELEN_INIT]; // initial typebuf.tb_buf static char_u noremapbuf_init[TYPELEN_INIT]; // initial typebuf.tb_noremap @@ -861,7 +861,7 @@ void init_default_mappings(void) // // If noremap is REMAP_YES, new string can be mapped again. // If noremap is REMAP_NONE, new string cannot be mapped again. -// If noremap is REMAP_SKIP, fist char of new string cannot be mapped again, +// If noremap is REMAP_SKIP, first char of new string cannot be mapped again, // but abbreviations are allowed. // If noremap is REMAP_SCRIPT, new string cannot be mapped again, except for // script-local mappings. @@ -1693,7 +1693,7 @@ typedef enum { map_result_fail, // failed, break loop map_result_get, // get a character from typeahead map_result_retry, // try to map again - map_result_nomatch // no matching mapping, get char + map_result_nomatch, // no matching mapping, get char } map_result_T; /// Handle mappings in the typeahead buffer. @@ -2470,7 +2470,7 @@ static int vgetorpeek(bool advance) /// Return the number of obtained characters. /// Return -1 when end of input script reached. /// -/// @param wait_time milli seconds +/// @param wait_time milliseconds int inchar(char_u *buf, int maxlen, long wait_time) { int len = 0; // Init for GCC. diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index faa9b38cf7..0f0cab33ea 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -923,11 +923,10 @@ static int cin_isfuncdecl(char_u **sp, linenr_T first_lnum, linenr_T min_lnum) while (*s && *s != ';' && *s != '\'' && *s != '"') { if (*s == ')' && cin_nocode(s + 1)) { - /* ')' at the end: may have found a match - * Check for he previous line not to end in a backslash: - * #if defined(x) && \ - * defined(y) - */ + // ')' at the end: may have found a match + // Check for the previous line not to end in a backslash: + // #if defined(x) && {backslash} + // defined(y) lnum = first_lnum - 1; s = ml_get(lnum); if (*s == NUL || s[STRLEN(s) - 1] != '\\') @@ -1634,8 +1633,8 @@ void parse_cino(buf_T *buf) * itself is also unclosed. */ buf->b_ind_unclosed2 = sw; - /* Suppress ignoring spaces from the indent of a line starting with an - * unclosed parentheses. */ + // Suppress ignoring spaces from the indent of a line starting with an + // unclosed parenthesis. buf->b_ind_unclosed_noignore = 0; /* If the opening paren is the last nonwhite character on the line, and @@ -1647,11 +1646,11 @@ void parse_cino(buf_T *buf) * an unclosed parentheses. */ buf->b_ind_unclosed_whiteok = 0; - /* Indent a closing parentheses under the line start of the matching - * opening parentheses. */ + // Indent a closing parenthesis under the line start of the matching + // opening parenthesis. buf->b_ind_matching_paren = 0; - // Indent a closing parentheses under the previous line. + // Indent a closing parenthesis under the previous line. buf->b_ind_paren_prev = 0; // Extra indent for comments. diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua index c1a1e7f162..f9b15d242a 100644 --- a/src/nvim/lua/vim.lua +++ b/src/nvim/lua/vim.lua @@ -424,7 +424,7 @@ end --- Without a runtime, writes to :Messages ---@see :help nvim_notify ---@param msg string Content of the notification to show to the user ----@param log_level number|nil enum from vim.log.levels +---@param log_level number|nil enum from |vim.log.levels| ---@param opts table|nil additional options (timeout, etc) function vim.notify(msg, log_level, opts) -- luacheck: no unused if log_level == vim.log.levels.ERROR then diff --git a/src/nvim/menu.c b/src/nvim/menu.c index ac4d52c392..0db9d69a7e 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -361,7 +361,7 @@ static int add_menu_path(const char_u *const menu_path, vimmenu_T *menuarg, goto erret; } - // Not already there, so lets add it + // Not already there, so let's add it menu = xcalloc(1, sizeof(vimmenu_T)); menu->modes = modes; diff --git a/src/nvim/message.c b/src/nvim/message.c index befca8c76b..39b023132e 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1269,7 +1269,7 @@ static void hit_return_msg(void) { int save_p_more = p_more; - p_more = FALSE; // don't want see this message when scrolling back + p_more = false; // don't want to see this message when scrolling back if (msg_didout) { // start on a new line msg_putchar('\n'); } diff --git a/src/nvim/move.c b/src/nvim/move.c index 15ba6645f5..67ec19903f 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -909,7 +909,7 @@ void curs_columns(win_T *wp, int may_scroll) } wp->w_skipcol = n * width; } else if (extra == 1) { - // less then 'scrolloff' lines above, decrease skipcol + // less than 'scrolloff' lines above, decrease skipcol assert(so <= INT_MAX); extra = (wp->w_skipcol + (int)so * width - wp->w_virtcol + width - 1) / width; @@ -920,7 +920,7 @@ void curs_columns(win_T *wp, int may_scroll) wp->w_skipcol -= extra * width; } } else if (extra == 2) { - // less then 'scrolloff' lines below, increase skipcol + // less than 'scrolloff' lines below, increase skipcol endcol = (n - wp->w_height_inner + 1) * width; while (endcol > wp->w_virtcol) { endcol -= width; diff --git a/src/nvim/ops.c b/src/nvim/ops.c index c6f9c5f04f..6c2db1e9ac 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -4123,7 +4123,7 @@ static int same_leader(linenr_T lnum, int leader1_len, char_u *leader1_flags, in * If first leader has 'f' flag, the lines can be joined only if the * second line does not have a leader. * If first leader has 'e' flag, the lines can never be joined. - * If fist leader has 's' flag, the lines can only be joined if there is + * If first leader has 's' flag, the lines can only be joined if there is * some text after it and the second line has the 'm' flag. */ if (leader1_flags != NULL) { diff --git a/src/nvim/option.c b/src/nvim/option.c index 65adda3c01..659965b64c 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1345,7 +1345,7 @@ int do_set(char_u *arg, int opt_flags) if (nextchar == '&') { // set to default val newval = options[opt_idx].def_val; - // expand environment variables and ~ (since the + // expand environment variables and ~ since the // default value was already expanded, only // required when an environment variable was set // later @@ -4132,7 +4132,7 @@ static char *set_bool_option(const int opt_idx, char_u *const varp, const int va } } - // Arabic requires a utf-8 encoding, inform the user if its not + // Arabic requires a utf-8 encoding, inform the user if it's not // set. if (STRCMP(p_enc, "utf-8") != 0) { static char *w_arabic = N_("W17: Arabic requires UTF-8, do ':set encoding=utf-8'"); diff --git a/src/nvim/plines.c b/src/nvim/plines.c index a061f76f34..a572f747df 100644 --- a/src/nvim/plines.c +++ b/src/nvim/plines.c @@ -83,7 +83,7 @@ int plines_win_nofill(win_T *wp, linenr_T lnum, bool winheight) return 1; } - // A folded lines is handled just like an empty line. + // Folded lines are handled just like an empty line. if (lineFolded(wp, lnum)) { return 1; } diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 32d0ebe8eb..0196e05455 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -3947,7 +3947,7 @@ static int qf_buf_add_line(qf_list_T *qfl, buf_T *buf, linenr_T lnum, const qfli int len; buf_T *errbuf; - // If the 'quickfixtextfunc' function returned an non-empty custom string + // If the 'quickfixtextfunc' function returned a non-empty custom string // for this entry, then use it. if (qftf_str != NULL && *qftf_str != NUL) { STRLCPY(IObuff, qftf_str, IOSIZE); diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 41c927eaa6..cafffc0319 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -2013,7 +2013,7 @@ static int nfa_regpiece(void) // will emit NFA_STAR. // Bail out if we can use the other engine, but only, when the // pattern does not need the NFA engine like (e.g. [[:upper:]]\{2,\} - // does not work with with characters > 8 bit with the BT engine) + // does not work with characters > 8 bit with the BT engine) if ((nfa_re_flags & RE_AUTO) && (maxval > 500 || maxval > minval + 200) && (maxval != MAX_LIMIT && minval < 200) @@ -4367,7 +4367,7 @@ static regsubs_T *addstate_here( // First add the state(s) at the end, so that we know how many there are. // Pass the listidx as offset (avoids adding another argument to - // addstate(). + // addstate()). regsubs_T *r = addstate(l, state, subs, pim, -listidx - ADDSTATE_HERE_OFFSET); if (r == NULL) { return NULL; diff --git a/src/nvim/screen.c b/src/nvim/screen.c index e62e3ca7bc..b1ca8c5805 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -3771,7 +3771,7 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool noc // Make sure, the highlighting for the tab char will be // correctly set further below (effectively reverts the - // FIX_FOR_BOGSUCOLS macro. + // FIX_FOR_BOGSUCOLS macro). if (n_extra == tab_len + vc_saved && wp->w_p_list && wp->w_p_lcs_chars.tab1) { tab_len += vc_saved; @@ -4294,7 +4294,7 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool noc // Store the character. // if (wp->w_p_rl && utf_char2cells(mb_c) > 1) { - // A double-wide character is: put first halve in left cell. + // A double-wide character is: put first half in left cell. off--; col--; } @@ -4637,8 +4637,8 @@ void screen_adjust_grid(ScreenGrid **grid, int *row_off, int *col_off) static bool use_cursor_line_sign(win_T *wp, linenr_T lnum) { return wp->w_p_cul - && lnum == wp->w_cursor.lnum - && (wp->w_p_culopt_flags & CULOPT_NBR); + && lnum == wp->w_cursor.lnum + && (wp->w_p_culopt_flags & CULOPT_NBR); } // Get information needed to display the sign in line 'lnum' in window 'wp'. @@ -4834,9 +4834,9 @@ static void grid_put_linebuf(ScreenGrid *grid, int row, int coloff, int endcol, end_dirty = col + char_cells; // When writing a single-width character over a double-width // character and at the end of the redrawn text, need to clear out - // the right halve of the old character. - // Also required when writing the right halve of a double-width - // char over the left halve of an existing one + // the right half of the old character. + // Also required when writing the right half of a double-width + // char over the left half of an existing one if (col + char_cells == endcol && ((char_cells == 1 && grid_off2cells(grid, off_to, max_off_to) > 1) @@ -5887,8 +5887,8 @@ void grid_puts_len(ScreenGrid *grid, char_u *text, int textlen, int row, int col } off = grid->line_offset[row] + col; - /* When drawing over the right halve of a double-wide char clear out the - * left halve. Only needed in a terminal. */ + // When drawing over the right half of a double-wide char clear out the + // left half. Only needed in a terminal. if (grid != &default_grid && col == 0 && grid_invalid_row(grid, row)) { // redraw the previous cell, make it empty put_dirty_first = -1; @@ -5950,9 +5950,9 @@ void grid_puts_len(ScreenGrid *grid, char_u *text, int textlen, int row, int col if (need_redraw) { // When at the end of the text and overwriting a two-cell // character with a one-cell character, need to clear the next - // cell. Also when overwriting the left halve of a two-cell char - // with the right halve of a two-cell char. Do this only once - // (utf8_off2cells() may return 2 on the right halve). + // cell. Also when overwriting the left half of a two-cell char + // with the right half of a two-cell char. Do this only once + // (utf8_off2cells() may return 2 on the right half). if (clear_next_cell) { clear_next_cell = false; } else if ((len < 0 ? ptr[mbyte_blen] == NUL @@ -6351,9 +6351,9 @@ void grid_fill(ScreenGrid *grid, int start_row, int end_row, int start_col, int } for (int row = start_row; row < end_row; row++) { - // When drawing over the right halve of a double-wide char clear - // out the left halve. When drawing over the left halve of a - // double wide-char clear out the right halve. Only needed in a + // When drawing over the right half of a double-wide char clear + // out the left half. When drawing over the left half of a + // double wide-char clear out the right half. Only needed in a // terminal. if (start_col > 0 && grid_fix_col(grid, start_col, row) != start_col) { grid_puts_len(grid, (char_u *)" ", 1, row, start_col - 1, 0); diff --git a/src/nvim/spell.c b/src/nvim/spell.c index bd31e98faa..9429a06e92 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -219,7 +219,7 @@ typedef struct { #define SCORE_THRES3 100 // word count threshold for COMMON3 // When trying changed soundfold words it becomes slow when trying more than -// two changes. With less then two changes it's slightly faster but we miss a +// two changes. With less than two changes it's slightly faster but we miss a // few good suggestions. In rare cases we need to try three of four changes. #define SCORE_SFMAX1 200 // maximum score for first try #define SCORE_SFMAX2 300 // maximum score for second try @@ -1628,7 +1628,7 @@ size_t spell_move_to(win_T *wp, int dir, bool allwords, bool curline, hlf_T *att } // For spell checking: concatenate the start of the following line "line" into -// "buf", blanking-out special characters. Copy less then "maxlen" bytes. +// "buf", blanking-out special characters. Copy less than "maxlen" bytes. // Keep the blanks at the start of the next line, this is used in win_line() // to skip those bytes if the word was OK. void spell_cat_line(char_u *buf, char_u *line, int maxlen) @@ -6106,7 +6106,7 @@ static void spell_soundfold_wsal(slang_T *slang, char_u *inword, char_u *res) for (; ((ws = smp[n].sm_lead_w)[0] & 0xff) == (c & 0xff) && ws[0] != NUL; ++n) { // Quickly skip entries that don't match the word. Most - // entries are less then three chars, optimize for that. + // entries are less than three chars, optimize for that. if (c != ws[0]) { continue; } @@ -7057,7 +7057,7 @@ void spell_dump_compl(char_u *pat, int ic, Direction *dir, int dumpflags_arg) arridx[depth] = idxs[n]; curi[depth] = 1; - // Check if this characters matches with the pattern. + // Check if this character matches with the pattern. // If not skip the whole tree below it. // Always ignore case here, dump_word() will check // proper case later. This isn't exactly right when diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index 42bb3c61a5..f6b95f37b1 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -4395,7 +4395,7 @@ static int write_vim_spell(spellinfo_T *spin, char_u *fname) // // The table with character flags and the table for case folding. // This makes sure the same characters are recognized as word characters - // when generating an when using a spell file. + // when generating and when using a spell file. // Skip this for ASCII, the table may conflict with the one used for // 'encoding'. // Also skip this for an .add.spl file, the main spell file must contain @@ -5122,7 +5122,7 @@ static int sug_filltable(spellinfo_T *spin, wordnode_T *node, int startwordnr, g wordnr++; // Remove extra NUL entries, we no longer need them. We don't - // bother freeing the nodes, the won't be reused anyway. + // bother freeing the nodes, they won't be reused anyway. while (p->wn_sibling != NULL && p->wn_sibling->wn_byte == NUL) { p->wn_sibling = p->wn_sibling->wn_sibling; } diff --git a/src/nvim/testdir/test_put.vim b/src/nvim/testdir/test_put.vim index f42b177c50..440717eaa8 100644 --- a/src/nvim/testdir/test_put.vim +++ b/src/nvim/testdir/test_put.vim @@ -113,14 +113,14 @@ func Test_put_p_indent_visual() endfunc func Test_multibyte_op_end_mark() - new - call setline(1, 'тест') - normal viwdp - call assert_equal([0, 1, 7, 0], getpos("'>")) - call assert_equal([0, 1, 7, 0], getpos("']")) - - normal Vyp - call assert_equal([0, 1, 2147483647, 0], getpos("'>")) - call assert_equal([0, 2, 7, 0], getpos("']")) - bwipe! - endfunc + new + call setline(1, 'тест') + normal viwdp + call assert_equal([0, 1, 7, 0], getpos("'>")) + call assert_equal([0, 1, 7, 0], getpos("']")) + + normal Vyp + call assert_equal([0, 1, 2147483647, 0], getpos("'>")) + call assert_equal([0, 2, 7, 0], getpos("']")) + bwipe! +endfunc diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index e7a60aca49..58061f020d 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1877,7 +1877,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term, const char *col "\x1b[?c"); } else if (konsolev > 0 && konsolev < 180770) { // Konsole before version 18.07.70: set up a nonce profile. This has - // side-effects on temporary font resizing. #6798 + // side effects on temporary font resizing. #6798 data->unibi_ext.set_cursor_style = (int)unibi_add_ext_str(ut, "Ss", TMUX_WRAP(tmux, "\x1b]50;CursorShape=%?" diff --git a/src/nvim/window.c b/src/nvim/window.c index c711f462d1..1e747a67e9 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -1591,7 +1591,7 @@ int make_windows(int count, bool vertical) int todo; if (vertical) { - // Each windows needs at least 'winminwidth' lines and a separator + // Each window needs at least 'winminwidth' lines and a separator // column. maxcount = (curwin->w_width + curwin->w_vsep_width - (p_wiw - p_wmw)) / (p_wmw + 1); @@ -2119,7 +2119,7 @@ static void win_equal_rec(win_T *next_curwin, bool current, frame_T *topfr, int m = frame_minheight(topfr, next_curwin); room = height - m; if (room < 0) { - // The room is less then 'winheight', use all space for the + // The room is less than 'winheight', use all space for the // current window. next_curwin_size = p_wh + room; room = 0; diff --git a/test/README.md b/test/README.md index c6e173ead2..cc630cb8bf 100644 --- a/test/README.md +++ b/test/README.md @@ -38,7 +38,7 @@ Layout - `/test/functional` : functional tests - `/test/unit` : unit tests - `/test/config` : contains `*.in` files which are transformed into `*.lua` - files using `configure_file` CMake command: this is for acessing CMake + files using `configure_file` CMake command: this is for accessing CMake variables in lua tests. - `/test/includes` : include-files for use by luajit `ffi.cdef` C definitions parser: normally used to make macros not accessible via this mechanism @@ -197,7 +197,7 @@ Guidelines (success + fail + error + pending) is the same in all environments. - *Note:* `pending()` is ignored if it is missing an argument, unless it is [contained in an `it()` block](https://github.com/neovim/neovim/blob/d21690a66e7eb5ebef18046c7a79ef898966d786/test/functional/ex_cmds/grep_spec.lua#L11). - Provide empty function argument if the `pending()` call is outside of `it()` + Provide empty function argument if the `pending()` call is outside `it()` ([example](https://github.com/neovim/neovim/commit/5c1dc0fbe7388528875aff9d7b5055ad718014de#diff-bf80b24c724b0004e8418102f68b0679R18)). - Really long `source([=[...]=])` blocks may break Vim's Lua syntax highlighting. Try `:syntax sync fromstart` to fix it. |