diff options
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/api.txt | 31 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 181 | ||||
-rw-r--r-- | runtime/doc/lsp.txt | 32 | ||||
-rw-r--r-- | runtime/doc/lua.txt | 4 | ||||
-rw-r--r-- | runtime/doc/options.txt | 2 | ||||
-rw-r--r-- | runtime/doc/repeat.txt | 13 | ||||
-rw-r--r-- | runtime/doc/usr_41.txt | 3 |
7 files changed, 231 insertions, 35 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 1e287281cf..0c17fa1669 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1311,6 +1311,34 @@ nvim_open_win({buffer}, {enter}, {config}) *nvim_open_win()* and clearing the |EndOfBuffer| region in 'winhighlight'. + • `border`: style of (optional) window border. This can + either be a string or an array. the string + values are: + • "none" No border. This is the default + • "single" a single line box + • "double" a double line box + • "shadow" a drop shadow effect by blending + with the background. If it is an array it + should be an array of eight items or any + divisor of eight. The array will specifify + the eight chars building up the border in a + clockwise fashion starting with the top-left + corner. As, an example, the double box style + could be specified as: [ "╔", "═" ,"╗", "║", + "╝", "═", "╚", "║" ] if the number of chars + are less than eight, they will be repeated. + Thus an ASCII border could be specified as: + [ "/", "-", "\\", "|" ] or all chars the + same as: [ "x" ] An empty string can be used + to turn off a specific border, for instance: + [ "", "", "", ">", "", "", "", "<" ] will + only make vertical borders but not + horizontal ones. By default `FloatBorder` + highlight is used which links to `VertSplit` + when not defined. It could also be specified + by character: [ {"+", "MyCorner"}, {"x", + "MyBorder"} ] + Return: ~ Window handle, or 0 on error @@ -2266,6 +2294,9 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts}) exists) will be shifted in when new text is inserted (true for right, false for left). Defaults to false. + • priority: a priority value for the highlight + group. For example treesitter highlighting + uses a value of 100. Return: ~ Id of the created/updated extmark diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 2911224de5..c3736d9a3e 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2047,6 +2047,7 @@ assert_inrange({lower}, {upper}, {actual} [, {msg}]) Number assert {actual} is inside the range assert_match({pat}, {text} [, {msg}]) Number assert {pat} matches {text} +assert_nobeep({cmd}) Number assert {cmd} does not cause a beep assert_notequal({exp}, {act} [, {msg}]) Number assert {exp} is not equal {act} assert_notmatch({pat}, {text} [, {msg}]) @@ -2394,6 +2395,7 @@ shellescape({string} [, {special}]) command argument shiftwidth([{col}]) Number effective value of 'shiftwidth' sign_define({name} [, {dict}]) Number define or update a sign +sign_define({list}) List define or update a list of signs sign_getdefined([{name}]) List get a list of defined signs sign_getplaced([{expr} [, {dict}]]) List get a list of placed signs @@ -2401,9 +2403,12 @@ sign_jump({id}, {group}, {expr}) Number jump to a sign sign_place({id}, {group}, {name}, {expr} [, {dict}]) Number place a sign +sign_placelist({list}) List place a list of signs sign_undefine([{name}]) Number undefine a sign +sign_undefine({list}) List undefine a list of signs sign_unplace({group} [, {dict}]) Number unplace a sign +sign_unplacelist({list}) List unplace a list of signs simplify({filename}) String simplify filename as much as possible sin({expr}) Float sine of {expr} sinh({expr}) Float hyperbolic sine of {expr} @@ -2638,7 +2643,8 @@ argv([{nr} [, {winid}]) assert_beeps({cmd}) *assert_beeps()* Run {cmd} and add an error message to |v:errors| if it does NOT produce a beep or visual bell. - Also see |assert_fails()| and |assert-return|. + Also see |assert_fails()|, |assert_nobeep()| and + |assert-return|. *assert_equal()* assert_equal({expected}, {actual}, [, {msg}]) @@ -2721,6 +2727,11 @@ assert_match({pattern}, {actual} [, {msg}]) < Will result in a string to be added to |v:errors|: test.vim line 12: Pattern '^f.*o$' does not match 'foobar' ~ +assert_nobeep({cmd}) *assert_nobeep()* + Run {cmd} and add an error message to |v:errors| if it + produces a beep or visual bell. + Also see |assert_beeps()|. + *assert_notequal()* assert_notequal({expected}, {actual} [, {msg}]) The opposite of `assert_equal()`: add an error message to @@ -5552,13 +5563,14 @@ id({expr}) *id()* Returns a |String| which is a unique identifier of the container type (|List|, |Dict| and |Partial|). It is guaranteed that for the mentioned types `id(v1) ==# id(v2)` - returns true iff `type(v1) == type(v2) && v1 is v2` (note: - |v:_null_list| and |v:_null_dict| have the same `id()` with - different types because they are internally represented as - a NULL pointers). Currently `id()` returns a hexadecimal - representanion of the pointers to the containers (i.e. like - `0x994a40`), same as `printf("%p", {expr})`, but it is advised - against counting on exact format of return value. + returns true iff `type(v1) == type(v2) && v1 is v2`. + Note that |v:_null_string|, |v:_null_list|, and |v:_null_dict| + have the same `id()` with different types because they are + internally represented as a NULL pointers. `id()` returns a + hexadecimal representanion of the pointers to the containers + (i.e. like `0x994a40`), same as `printf("%p", {expr})`, + but it is advised against counting on the exact format of + return value. It is not guaranteed that `id(no_longer_existing_container)` will not be equal to some other `id()`: new containers may @@ -7920,6 +7932,7 @@ shiftwidth([{col}]) *shiftwidth()* will be assumed. sign_define({name} [, {dict}]) *sign_define()* +sign_define({list}) Define a new sign named {name} or modify the attributes of an existing sign. This is similar to the |:sign-define| command. @@ -7929,24 +7942,38 @@ sign_define({name} [, {dict}]) *sign_define()* The {name} can be a String or a Number. The optional {dict} argument specifies the sign attributes. The following values are supported: - icon full path to the bitmap file for the sign. - linehl highlight group used for the whole line the + icon full path to the bitmap file for the sign. + linehl highlight group used for the whole line the sign is placed in. - text text that is displayed when there is no icon + text text that is displayed when there is no icon or the GUI is not being used. - texthl highlight group used for the text item - numhl highlight group used for 'number' column at the + texthl highlight group used for the text item + numhl highlight group used for 'number' column at the associated line. Overrides |hl-LineNr|, |hl-CursorLineNr|. If the sign named {name} already exists, then the attributes of the sign are updated. - Returns 0 on success and -1 on failure. + The one argument {list} can be used to define a list of signs. + Each list item is a dictionary with the above items in {dict} + and a 'name' item for the sign name. + + Returns 0 on success and -1 on failure. When the one argument + {list} is used, then returns a List of values one for each + defined sign. Examples: > - call sign_define("mySign", {"text" : "=>", "texthl" : - \ "Error", "linehl" : "Search"}) + call sign_define("mySign", { + \ "text" : "=>", + \ "texthl" : "Error", + \ "linehl" : "Search"}) + call sign_define([ + \ {'name' : 'sign1', + \ 'text' : '=>'}, + \ {'name' : 'sign2', + \ 'text' : '!!'} + \ ]) < sign_getdefined([{name}]) *sign_getdefined()* Get a list of defined signs and their attributes. @@ -7958,14 +7985,14 @@ sign_getdefined([{name}]) *sign_getdefined()* Each list item in the returned value is a dictionary with the following entries: - icon full path to the bitmap file of the sign - linehl highlight group used for the whole line the + icon full path to the bitmap file of the sign + linehl highlight group used for the whole line the sign is placed in. - name name of the sign - text text that is displayed when there is no icon + name name of the sign + text text that is displayed when there is no icon or the GUI is not being used. - texthl highlight group used for the text item - numhl highlight group used for 'number' column at the + texthl highlight group used for the text item + numhl highlight group used for 'number' column at the associated line. Overrides |hl-LineNr|, |hl-CursorLineNr|. @@ -8056,25 +8083,25 @@ sign_jump({id}, {group}, {expr}) < *sign_place()* sign_place({id}, {group}, {name}, {expr} [, {dict}]) - Place the sign defined as {name} at line {lnum} in file {expr} - and assign {id} and {group} to sign. This is similar to the - |:sign-place| command. + Place the sign defined as {name} at line {lnum} in file or + buffer {expr} and assign {id} and {group} to sign. This is + similar to the |:sign-place| command. If the sign identifier {id} is zero, then a new identifier is allocated. Otherwise the specified number is used. {group} is the sign group name. To use the global sign group, use an empty string. {group} functions as a namespace for {id}, thus two groups can use the same IDs. Refer to |sign-identifier| - for more information. + and |sign-group| for more information. {name} refers to a defined sign. {expr} refers to a buffer name or number. For the accepted values, see |bufname()|. The optional {dict} argument supports the following entries: - lnum line number in the buffer {expr} where - the sign is to be placed. For the - accepted values, see |line()|. + lnum line number in the file or buffer + {expr} where the sign is to be placed. + For the accepted values, see |line()|. priority priority of the sign. See |sign-priority| for more information. @@ -8103,17 +8130,85 @@ sign_place({id}, {group}, {name}, {expr} [, {dict}]) call sign_place(10, 'g3', 'sign4', 'json.c', \ {'lnum' : 40, 'priority' : 90}) < + *sign_placelist()* +sign_placelist({list}) + Place one or more signs. This is similar to the + |sign_place()| function. The {list} argument specifies the + List of signs to place. Each list item is a dict with the + following sign attributes: + buffer buffer name or number. For the accepted + values, see |bufname()|. + group sign group. {group} functions as a namespace + for {id}, thus two groups can use the same + IDs. If not specified or set to an empty + string, then the global group is used. See + |sign-group| for more information. + id sign identifier. If not specified or zero, + then a new unique identifier is allocated. + Otherwise the specified number is used. See + |sign-identifier| for more information. + lnum line number in the buffer {expr} where the + sign is to be placed. For the accepted values, + see |line()|. + name name of the sign to place. See |sign_define()| + for more information. + priority priority of the sign. When multiple signs are + placed on a line, the sign with the highest + priority is used. If not specified, the + default value of 10 is used. See + |sign-priority| for more information. + + If {id} refers to an existing sign, then the existing sign is + modified to use the specified {name} and/or {priority}. + + Returns a List of sign identifiers. If failed to place a + sign, the corresponding list item is set to -1. + + Examples: > + " Place sign s1 with id 5 at line 20 and id 10 at line + " 30 in buffer a.c + let [n1, n2] = sign_place([ + \ {'id' : 5, + \ 'name' : 's1', + \ 'buffer' : 'a.c', + \ 'lnum' : 20}, + \ {'id' : 10, + \ 'name' : 's1', + \ 'buffer' : 'a.c', + \ 'lnum' : 30} + \ ]) + + " Place sign s1 in buffer a.c at line 40 and 50 + " with auto-generated identifiers + let [n1, n2] = sign_place([ + \ {'name' : 's1', + \ 'buffer' : 'a.c', + \ 'lnum' : 40}, + \ {'name' : 's1', + \ 'buffer' : 'a.c', + \ 'lnum' : 50} + \ ]) +< sign_undefine([{name}]) *sign_undefine()* +sign_undefine({list}) Deletes a previously defined sign {name}. This is similar to the |:sign-undefine| command. If {name} is not supplied, then deletes all the defined signs. - Returns 0 on success and -1 on failure. + The one argument {list} can be used to undefine a list of + signs. Each list item is the name of a sign. + + Returns 0 on success and -1 on failure. For the one argument + {list} call, returns a list of values one for each undefined + sign. Examples: > " Delete a sign named mySign call sign_undefine("mySign") + " Delete signs 'sign1' and 'sign2' + call sign_undefine(["sign1", "sign2"]) + " Delete all the signs call sign_undefine() < @@ -8159,6 +8254,32 @@ sign_unplace({group} [, {dict}]) *sign_unplace()* " Remove all the placed signs from all the buffers call sign_unplace('*') < +sign_unplacelist({list}) *sign_unplacelist()* + Remove previously placed signs from one or more buffers. This + is similar to the |sign_unplace()| function. + + The {list} argument specifies the List of signs to remove. + Each list item is a dict with the following sign attributes: + buffer buffer name or number. For the accepted + values, see |bufname()|. If not specified, + then the specified sign is removed from all + the buffers. + group sign group name. If not specified or set to an + empty string, then the global sign group is + used. If set to '*', then all the groups + including the global group are used. + id sign identifier. If not specified, then all + the signs in the specified group are removed. + + Returns a List where an entry is set to 0 if the corresponding + sign was successfully removed or -1 on failure. + + Example: > + " Remove sign with id 10 from buffer a.vim and sign + " with id 20 from buffer b.vim + call sign_unplace([{'id' : 10, 'buffer' : "a.vim"}, + \ {'id' : 20, 'buffer' : 'b.vim'}]) +< simplify({filename}) *simplify()* Simplify the file name as much as possible without changing the meaning. Shortcuts (on MS-Windows) or symbolic links (on diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 67a10c7efb..3c0dbf96c5 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -1467,6 +1467,25 @@ progress_handler({_}, {_}, {params}, {client_id}) See also: ~ https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_executeCommand + *vim.lsp.handlers.signature_help()* +signature_help({_}, {method}, {result}, {_}, {bufnr}, {config}) + Parameters: ~ + {config} table Configuration table. + • border: (default=nil) + • Add borders to the floating window + • See |vim.api.nvim_open_win()| + + See also: ~ + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_declaration@seehttps://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition@seehttps://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_typeDefinition@seehttps://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_implementation|lsp-handler| for the method "textDocument/signatureHelp"> + + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + -- Use a sharp border with `FloatBorder` highlights + border = "single" + } + ) +< + ============================================================================== Lua module: vim.lsp.util *lsp-util* @@ -1541,13 +1560,20 @@ close_preview_autocmd({events}, {winnr}) |autocmd-events| *vim.lsp.util.compute_diff()* -compute_diff({old_lines}, {new_lines}, {start_line_idx}, {end_line_idx}) +compute_diff({old_lines}, {new_lines}, {start_line_idx}, {end_line_idx}, + {offset_encoding}) Returns the range table for the difference between old and new lines Parameters: ~ - {old_lines} table list of lines - {new_lines} table list of lines + {old_lines} table list of lines + {new_lines} table list of lines + {start_line_idx} int line to begin search for first + difference + {end_line_idx} int line to begin search for last + difference + {offset_encoding} string encoding requested by language + server Return: ~ table start_line_idx and start_col_idx of range diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index c2fc25431c..6d007c0e44 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -18,7 +18,8 @@ an idea of what lurks beneath: > Nvim includes a "standard library" |lua-stdlib| for Lua. It complements the "editor stdlib" (|functions| and Ex commands) and the |API|, all of which can -be used from Lua code. +be used from Lua code. A good overview of using Lua in neovim is given by +https://github.com/nanotee/nvim-lua-guide. Module conflicts are resolved by "last wins". For example if both of these are on 'runtimepath': @@ -831,6 +832,7 @@ LUA-VIMSCRIPT BRIDGE *lua-vimscript* Nvim Lua provides an interface to Vimscript variables and functions, and editor commands and options. +See also https://github.com/nanotee/nvim-lua-guide. vim.call({func}, {...}) *vim.call()* Invokes |vim-function| or |user-function| {func} with arguments {...}. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 04310ca8d4..651d4c4bc7 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4818,7 +4818,7 @@ A jump table for the options with a short description can be found at |Q_op|. |xdg| ($XDG_CONFIG_DIRS, defaults to /etc/xdg). This also contains preferences from system administrator. 3. Data home directory, for plugins installed by user. - Given by `stdpath("data")`. |$XDG_DATA_HOME| + Given by `stdpath("data")/site`. |$XDG_DATA_HOME| 4. nvim/site subdirectories for each directory in $XDG_DATA_DIRS. This is for plugins which were installed by system administrator, but are not part of the Nvim distribution. XDG_DATA_DIRS defaults diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 604c969c64..3a7337d2e8 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -804,6 +804,19 @@ DEFINING BREAKPOINTS < Note that this only works for commands that are executed when sourcing the file, not for a function defined in that file. +:breaka[dd] expr {expression} + Sets a breakpoint, that will break whenever the {expression} + evaluates to a different value. Example: > + :breakadd expr g:lnum + +< Will break, whenever the global variable lnum changes. + Note if you watch a |script-variable| this will break + when switching scripts, since the script variable is only + valid in the script where it has been defined and if that + script is called from several other scripts, this will stop + whenever that particular variable will become visible or + unaccessible again. + The [lnum] is the line number of the breakpoint. Vim will stop at or after this line. When omitted line 1 is used. diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 97aacc1403..21f5dcc815 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -943,8 +943,10 @@ Signs: *sign-functions* sign_getplaced() get a list of placed signs sign_jump() jump to a sign sign_place() place a sign + sign_placelist() place a list of signs sign_undefine() undefine a sign sign_unplace() unplace a sign + sign_unplacelist() unplace a list of signs Testing: *test-functions* @@ -958,6 +960,7 @@ Testing: *test-functions* assert_true() assert that an expression is true assert_exception() assert that a command throws an exception assert_beeps() assert that a command beeps + assert_nobeep() assert that a command does not cause a beep assert_fails() assert that a command fails Timers: *timer-functions* |