From 792c2903435ceda05e68007d7bee344f65ee3a4f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 16 Sep 2019 21:02:49 -0400 Subject: vim-patch:8.0.1523: cannot write and read terminal screendumps Problem: Cannot write and read terminal screendumps. Solution: Add term_dumpwrite(), term_dumpread() and term_dumpdiff(). Also add assert_equalfile(). https://github.com/vim/vim/commit/d96ff165113ce5fe62107add590997660e3d4802 --- runtime/doc/eval.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 512cfc4e58..fb39617c17 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2007,6 +2007,8 @@ argv([-1, {winid}]) List the argument list assert_beeps({cmd}) none assert {cmd} causes a beep assert_equal({exp}, {act} [, {msg}]) none assert {exp} is equal to {act} +assert_equalfile({fname-one}, {fname-two}) + none assert file contents is equal assert_exception({error} [, {msg}]) none assert {error} is in v:exception assert_fails({cmd} [, {error}]) none assert {cmd} fails @@ -2597,6 +2599,13 @@ assert_equal({expected}, {actual}, [, {msg}]) < Will result in a string to be added to |v:errors|: test.vim line 12: Expected 'foo' but got 'bar' ~ + *assert_equalfile()* +assert_equalfile({fname-one}, {fname-two}) + When the files {fname-one} and {fname-two} do not contain + exactly the same text an error message is added to |v:errors|. + When {fname-one} or {fname-two} does not exist the error will + mention that. + assert_exception({error} [, {msg}]) *assert_exception()* When v:exception does not contain the string {error} an error message is added to |v:errors|. @@ -4479,8 +4488,7 @@ getftype({fname}) *getftype()* systems that support it. On some systems only "dir" and "file" are returned. - *getjumplist()* -getjumplist([{winnr} [, {tabnr}]]) +getjumplist([{winnr} [, {tabnr}]]) *getjumplist()* Returns the |jumplist| for the specified window. Without arguments use the current window. -- cgit From 8db9e82e3e1aa094ca9224b01384da1b07fda410 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 16 Sep 2019 22:26:41 -0400 Subject: vim-patch:8.0.1770: assert functions don't return anything Problem: Assert functions don't return anything. Solution: Return non-zero when the assertion fails. https://github.com/vim/vim/commit/65a5464985f980d2bbbf4e14d39d416dce065ec7 --- runtime/doc/eval.txt | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index fb39617c17..bac7709ef5 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1547,10 +1547,12 @@ v:errmsg Last given error message. :if v:errmsg != "" : ... handle error < - *v:errors* *errors-variable* + *v:errors* *errors-variable* *assert-return* v:errors Errors found by assert functions, such as |assert_true()|. This is a list of strings. The assert functions append an item when an assert fails. + The return value indicates this: a one is returned if an item + was added to v:errors, otherwise zero is returned. To remove old results make it empty: > :let v:errors = [] < If v:errors is set to anything but a list it is made an empty @@ -2004,26 +2006,26 @@ argidx() Number current index in the argument list arglistid([{winnr} [, {tabnr}]]) Number argument list id argv({nr} [, {winid}]) String {nr} entry of the argument list argv([-1, {winid}]) List the argument list -assert_beeps({cmd}) none assert {cmd} causes a beep +assert_beeps({cmd}) Number assert {cmd} causes a beep assert_equal({exp}, {act} [, {msg}]) - none assert {exp} is equal to {act} + Number assert {exp} is equal to {act} assert_equalfile({fname-one}, {fname-two}) - none assert file contents is equal + Number assert file contents is equal assert_exception({error} [, {msg}]) - none assert {error} is in v:exception -assert_fails({cmd} [, {error}]) none assert {cmd} fails + Number assert {error} is in v:exception +assert_fails({cmd} [, {error}]) Number assert {cmd} fails assert_false({actual} [, {msg}]) - none assert {actual} is false + Number assert {actual} is false assert_inrange({lower}, {upper}, {actual} [, {msg}]) - none assert {actual} is inside the range + Number assert {actual} is inside the range assert_match({pat}, {text} [, {msg}]) - none assert {pat} matches {text} + Number assert {pat} matches {text} assert_notequal({exp}, {act} [, {msg}]) - none assert {exp} is not equal {act} + Number assert {exp} is not equal {act} assert_notmatch({pat}, {text} [, {msg}]) - none assert {pat} not matches {text} -assert_report({msg}) none report a test failure -assert_true({actual} [, {msg}]) none assert {actual} is true + Number assert {pat} not matches {text} +assert_report({msg}) Number report a test failure +assert_true({actual} [, {msg}]) Number assert {actual} is true asin({expr}) Float arc sine of {expr} atan({expr}) Float arc tangent of {expr} atan2({expr}, {expr}) Float arc tangent of {expr1} / {expr2} @@ -2582,12 +2584,13 @@ 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()|. + Also see |assert_fails()| and |assert-return|. *assert_equal()* assert_equal({expected}, {actual}, [, {msg}]) When {expected} and {actual} are not equal an error message is - added to |v:errors|. + added to |v:errors| and 1 is returned. Otherwise zero is + returned |assert-return|. There is no automatic conversion, the String "4" is different from the Number 4. And the number 4 is different from the Float 4.0. The value of 'ignorecase' is not used here, case @@ -2603,12 +2606,13 @@ assert_equal({expected}, {actual}, [, {msg}]) assert_equalfile({fname-one}, {fname-two}) When the files {fname-one} and {fname-two} do not contain exactly the same text an error message is added to |v:errors|. + Also see |assert-return|. When {fname-one} or {fname-two} does not exist the error will mention that. assert_exception({error} [, {msg}]) *assert_exception()* When v:exception does not contain the string {error} an error - message is added to |v:errors|. + message is added to |v:errors|. Also see |assert-return|. This can be used to assert that a command throws an exception. Using the error number, followed by a colon, avoids problems with translations: > @@ -2621,7 +2625,7 @@ assert_exception({error} [, {msg}]) *assert_exception()* assert_fails({cmd} [, {error} [, {msg}]]) *assert_fails()* Run {cmd} and add an error message to |v:errors| if it does - NOT produce an error. + NOT produce an error. Also see |assert-return|. When {error} is given it must match in |v:errmsg|. Note that beeping is not considered an error, and some failing commands only beep. Use |assert_beeps()| for those. @@ -2629,6 +2633,7 @@ assert_fails({cmd} [, {error} [, {msg}]]) *assert_fails()* assert_false({actual} [, {msg}]) *assert_false()* When {actual} is not false an error message is added to |v:errors|, like with |assert_equal()|. + Also see |assert-return|. A value is false when it is zero or |v:false|. When "{actual}" is not a number or |v:false| the assert fails. When {msg} is omitted an error in the form @@ -2645,7 +2650,7 @@ assert_inrange({lower}, {upper}, {actual} [, {msg}]) *assert_inrange()* *assert_match()* assert_match({pattern}, {actual} [, {msg}]) When {pattern} does not match {actual} an error message is - added to |v:errors|. + added to |v:errors|. Also see |assert-return|. {pattern} is used as with |=~|: The matching is always done like 'magic' was set and 'cpoptions' is empty, no matter what @@ -2666,18 +2671,22 @@ assert_match({pattern}, {actual} [, {msg}]) assert_notequal({expected}, {actual} [, {msg}]) The opposite of `assert_equal()`: add an error message to |v:errors| when {expected} and {actual} are equal. + Also see |assert-return|. *assert_notmatch()* assert_notmatch({pattern}, {actual} [, {msg}]) The opposite of `assert_match()`: add an error message to |v:errors| when {pattern} matches {actual}. + Also see |assert-return|. assert_report({msg}) *assert_report()* Report a test failure directly, using {msg}. + Always returns one. assert_true({actual} [, {msg}]) *assert_true()* When {actual} is not true an error message is added to |v:errors|, like with |assert_equal()|. + Also see |assert-return|. A value is |TRUE| when it is a non-zero number or |v:true|. When {actual} is not a number or |v:true| the assert fails. When {msg} is omitted an error in the form "Expected True but -- cgit From ca116625153d806bd192f0f533346cc9536904a9 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 20 Sep 2019 02:18:38 -0400 Subject: vim-patch:8.0.1539: no test for the popup menu positioning Problem: No test for the popup menu positioning. Solution: Add a screendump test for the popup menu. https://github.com/vim/vim/commit/6bb2cdfe604e51eec216cbe23bb6e8fb47810347 --- runtime/doc/eval.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index bac7709ef5..5e6bfd0dbc 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -6657,7 +6657,7 @@ remote_expr({server}, {string} [, {idvar} [, {timeout}]]) between (not at the end), like with join(expr, "\n"). If {idvar} is present and not empty, it is taken as the name of a variable and a {serverid} for later use with - remote_read() is stored there. + |remote_read()| is stored there. If {timeout} is given the read times out after this many seconds. Otherwise a timeout of 600 seconds is used. See also |clientserver| |RemoteReply|. -- cgit From b1ada8ec2159fbc69b58cc40eb62a4e76edd8d45 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sun, 22 Sep 2019 21:47:24 +0200 Subject: vim-patch:8.1.1354: getting a list of text lines is clumsy Problem: Getting a list of text lines is clumsy. Solution: Add the =<< assignment. (Yegappan Lakshmanan, closes vim/vim#4386) https://github.com/vim/vim/commit/f5842c5a533346c4ff41ff666e465c85f1de35d5 --- runtime/doc/eval.txt | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 5e6bfd0dbc..607e88b7c8 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -9779,6 +9779,44 @@ This does NOT work: > Like above, but append/add/subtract the value for each |List| item. + *:let=<<* *:let-heredoc* *E990* *E991* +:let {var-name} =<< [trim] {marker} +text... +text... +{marker} + Set internal variable {var-name} to a List containing + the lines of text bounded by the string {marker}. + {marker} must not contain white space. + The last line should end only with the {marker} string + without any other character. Watch out for white + space after {marker}! + If {marker} is not supplied, then "." is used as the + default marker. + + Any white space characters in the lines of text are + preserved. If "trim" is specified before {marker}, + then all the leading indentation exactly matching the + leading indentation before `let` is stripped from the + input lines and the line containing {marker}. Note + that the difference between space and tab matters + here. + + If {var-name} didn't exist yet, it is created. + Cannot be followed by another command, but can be + followed by a comment. + + Examples: > + let var1 =<< END + Sample text 1 + Sample text 2 + Sample text 3 + END + + let data =<< trim DATA + 1 2 3 4 + 5 6 7 8 + DATA +< *E121* :let {var-name} .. List the value of variable {var-name}. Multiple variable names may be given. Special names recognized -- cgit From 6c012b0624935b93e92a0b12d86d49ef695210ba Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 12 Oct 2019 09:48:48 +0200 Subject: vim-patch:8.1.1585: :let-heredoc does not trim enough Problem: :let-heredoc does not trim enough. Solution: Trim indent from the contents based on the indent of the first line. Use let-heredoc in more tests. https://github.com/vim/vim/commit/e7eb92708ec2092a2fc11e78703b5dcf83844412 --- runtime/doc/eval.txt | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 607e88b7c8..8cdaef007c 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -9793,13 +9793,24 @@ text... If {marker} is not supplied, then "." is used as the default marker. - Any white space characters in the lines of text are - preserved. If "trim" is specified before {marker}, - then all the leading indentation exactly matching the - leading indentation before `let` is stripped from the - input lines and the line containing {marker}. Note - that the difference between space and tab matters - here. + Without "trim" any white space characters in the lines + of text are preserved. If "trim" is specified before + {marker}, then indentation is stripped so you can do: > + let text =<< trim END + if ok + echo 'done' + endif + END +< Results in: ["if ok", " echo 'done'", "endif"] + The marker must line up with "let" and the indentation + of the first line is removed from all the text lines. + Specifically: all the leading indentation exactly + matching the leading indentation of the first + non-empty text line is stripped from the input lines. + All leading indentation exactly matching the leading + indentation before `let` is stripped from the line + containing {marker}. Note that the difference between + space and tab matters here. If {var-name} didn't exist yet, it is created. Cannot be followed by another command, but can be -- cgit From 3b894b1cb18a9d4e399ab5b55004767f63a384c3 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 12 Oct 2019 23:47:00 +0200 Subject: vim-patch:8.1.1723: heredoc assignment has no room for new features Problem: Heredoc assignment has no room for new features. (FUJIWARA Takuya) Solution: Require the marker does not start with a lower case character. (closes vim/vim#4705) https://github.com/vim/vim/commit/24582007294b0db3be9669d3b583ea45fc4f19b8 --- runtime/doc/eval.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 8cdaef007c..77b6ee24a4 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -9779,19 +9779,18 @@ This does NOT work: > Like above, but append/add/subtract the value for each |List| item. - *:let=<<* *:let-heredoc* *E990* *E991* + *:let=<<* *:let-heredoc* + *E990* *E991* *E172* *E221* :let {var-name} =<< [trim] {marker} text... text... {marker} Set internal variable {var-name} to a List containing the lines of text bounded by the string {marker}. - {marker} must not contain white space. + {marker} cannot start with a lower case character. The last line should end only with the {marker} string without any other character. Watch out for white space after {marker}! - If {marker} is not supplied, then "." is used as the - default marker. Without "trim" any white space characters in the lines of text are preserved. If "trim" is specified before -- cgit From f3d6d8750b70d56f92d6ece87031ed205abdfcca Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 13 Oct 2019 19:49:17 -0400 Subject: vim-patch:8.1.0345: cannot get the window id associated with the location list Problem: Cannot get the window id associated with the location list. Solution: Add the "filewinid" argument to getloclist(). (Yegappan Lakshmanan, closes vim/vim#3202) https://github.com/vim/vim/commit/c9cc9c78f21caba7ecb5c90403df5e19a57aa96a --- runtime/doc/eval.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 77b6ee24a4..d21e441888 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4553,6 +4553,10 @@ getloclist({nr},[, {what}]) *getloclist()* If the optional {what} dictionary argument is supplied, then returns the items listed in {what} as a dictionary. Refer to |getqflist()| for the supported items in {what}. + If {what} contains 'filewinid', then returns the id of the + window used to display files from the location list. This + field is applicable only when called from a location list + window. getmatches() *getmatches()* Returns a |List| with all matches previously defined for the -- cgit From 9ef16a1628722958b6e14fe9274006e50ed6682d Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 27 Oct 2019 15:05:59 -0700 Subject: doc: vim.fn, vim.call(), vim.api [ci skip] --- runtime/doc/eval.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index d21e441888..1eb873a5b4 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1217,7 +1217,7 @@ lambda expression *expr-lambda* *lambda* {args -> expr1} lambda expression A lambda expression creates a new unnamed function which returns the result of -evaluating |expr1|. Lambda expressions differ from |user-functions| in +evaluating |expr1|. Lambda expressions differ from |user-function|s in the following ways: 1. The body of the lambda expression is an |expr1| and not a sequence of |Ex| @@ -1986,9 +1986,12 @@ v:windowid Application-specific window "handle" which may be set by any |window-ID|. ============================================================================== -4. Builtin Functions *functions* +4. Builtin Functions *vim-function* *functions* -See |function-list| for a list grouped by what the function is used for. +The Vimscript subsystem (referred to as "eval" internally) provides the +following builtin functions. Scripts can also define |user-function|s. + +See |function-list| to browse functions by topic. (Use CTRL-] on the function name to jump to the full explanation.) @@ -3543,7 +3546,7 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is string) *funcname built-in function (see |functions|) or user defined function (see - |user-functions|). Also works for a + |user-function|). Also works for a variable that is a Funcref. varname internal variable (see |internal-variables|). Also works @@ -9243,7 +9246,7 @@ Don't forget that "^" will only match at the first character of the String and "\n". ============================================================================== -5. Defining functions *user-functions* +5. Defining functions *user-function* New functions can be defined. These can be called just like builtin functions. The function executes a sequence of Ex commands. Normal mode -- cgit From dab40f43b18d35b283804ecb033310198cbf7548 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Wed, 30 Oct 2019 20:53:09 +0100 Subject: Add v:lua.func() vimL syntax for calling lua Also simplify error messages when calling lua from vimL. --- runtime/doc/eval.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 1eb873a5b4..79bf81dc0e 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1737,6 +1737,10 @@ v:lnum Line number for the 'foldexpr' |fold-expr|, 'formatexpr' and expressions is being evaluated. Read-only when in the |sandbox|. + *v:lua* *lua-variable* +v:lua Prefix for calling lua functions from expressions. + See |v:lua-call| for more information. + *v:mouse_win* *mouse_win-variable* v:mouse_win Window number for a mouse click obtained with |getchar()|. First window has number 1, like with |winnr()|. The value is -- cgit From af53a0c0123338575dd59934449d7fe836835d1c Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 17 Nov 2019 19:06:59 -0800 Subject: doc: Lua [ci skip] #11378 - Rework :help lua-commands - Rename if_lua.txt => lua.txt --- runtime/doc/eval.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 79bf81dc0e..84a893a205 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1738,7 +1738,7 @@ v:lnum Line number for the 'foldexpr' |fold-expr|, 'formatexpr' and |sandbox|. *v:lua* *lua-variable* -v:lua Prefix for calling lua functions from expressions. +v:lua Prefix for calling Lua functions from expressions. See |v:lua-call| for more information. *v:mouse_win* *mouse_win-variable* -- cgit From fd5710ae9a3bcbc0f9cbb71de9e39253350ff09c Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 25 Nov 2019 01:08:02 -0800 Subject: doc + extmarks tweaks #11421 - nvim_buf_get_extmarks: rename "amount" => "limit" - rename `set_extmark_index_from_obj` --- runtime/doc/eval.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 84a893a205..f39c40492b 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4727,7 +4727,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()* getregtype([{regname}]) *getregtype()* The result is a String, which is type of register {regname}. The value will be one of: - "v" for |characterwise| text + "v" for |charwise| text "V" for |linewise| text "{width}" for |blockwise-visual| text "" for an empty or unknown register @@ -6131,7 +6131,7 @@ mode([expr]) Return a string that indicates the current mode. n Normal no Operator-pending - nov Operator-pending (forced characterwise |o_v|) + nov Operator-pending (forced charwise |o_v|) noV Operator-pending (forced linewise |o_V|) noCTRL-V Operator-pending (forced blockwise |o_CTRL-V|) niI Normal using |i_CTRL-O| in |Insert-mode| @@ -7441,7 +7441,7 @@ setreg({regname}, {value} [, {options}]) If {options} contains "a" or {regname} is upper case, then the value is appended. {options} can also contain a register type specification: - "c" or "v" |characterwise| mode + "c" or "v" |charwise| mode "l" or "V" |linewise| mode "b" or "" |blockwise-visual| mode If a number immediately follows "b" or "" then this is @@ -9708,7 +9708,7 @@ This does NOT work: > register, "@/" for the search pattern. If the result of {expr1} ends in a or , the register will be linewise, otherwise it will be set to - characterwise. + charwise. This can be used to clear the last search pattern: > :let @/ = "" < This is different from searching for an empty string, -- cgit From 6c6afbcddd05336b7a6d98e5025c9c8206d4f903 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 30 Nov 2019 05:52:24 -0500 Subject: doc: mention OS pseudo-features in :h feature-list --- runtime/doc/eval.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index f39c40492b..ab65cc4560 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4969,9 +4969,11 @@ has({feature}) Returns 1 if {feature} is supported, 0 otherwise. The < *feature-list* List of supported pseudo-feature names: acl |ACL| support + bsd BSD system (not macOS, use "mac" for that). iconv Can use |iconv()| for conversion. +shellslash Can use backslashes in filenames (Windows) clipboard |clipboard| provider is available. + mac MacOS system. nvim This is Nvim. python2 Legacy Vim |python2| interface. |has-python| python3 Legacy Vim |python3| interface. |has-python| @@ -4981,6 +4983,7 @@ has({feature}) Returns 1 if {feature} is supported, 0 otherwise. The unix Unix system. *vim_starting* True during |startup|. win32 Windows system (32 or 64 bit). + win64 Windows system (64 bit). wsl WSL (Windows Subsystem for Linux) system *has-patch* -- cgit From 19b6237087ebcf45427ceb6943d23ce33b39567f Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Fri, 9 Nov 2018 23:57:00 +0900 Subject: jobstart now supports env/clear_env to modify the environment of the launched job. --- runtime/doc/eval.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index ab65cc4560..597175b5e5 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -5451,6 +5451,9 @@ jobstart({cmd}[, {opts}]) *jobstart()* |on_exit| : exit event handler (function name or |Funcref|) cwd : Working directory of the job; defaults to |current-directory|. + env : A dict of strings to append (or replace see + |clear_env|) to the current environment. + clear_env: If set, use the exact values passed in |env| rpc : If set, |msgpack-rpc| will be used to communicate with the job over stdin and stdout. "on_stdout" is then ignored, but "on_stderr" can still be used. -- cgit From 251b20e5334e1ff8af7fdd37ca1770ad485f031b Mon Sep 17 00:00:00 2001 From: Seth Fowler Date: Mon, 16 Dec 2019 14:08:55 -0500 Subject: Add support for the pum_getpos() API (#11562) Add support for the pum_getpos() API --- runtime/doc/eval.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 597175b5e5..d02ed54e27 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2280,6 +2280,7 @@ pathshorten({expr}) String shorten directory names in a path pow({x}, {y}) Float {x} to the power of {y} prevnonblank({lnum}) Number line nr of non-blank line <= {lnum} printf({fmt}, {expr1}...) String format text +pum_getpos() Dict position and size of pum if visible pumvisible() Number whether popup menu is visible pyeval({expr}) any evaluate |Python| expression py3eval({expr}) any evaluate |python3| expression @@ -3120,6 +3121,9 @@ complete_info([{what}]) the items listed in {what} are returned. Unsupported items in {what} are silently ignored. + To get the position of the popup menu, see |pum_getpos()|. It's + also available in |v:event| during the |CompleteChanged| event. + Examples: > " Get all items call complete_info() @@ -6521,6 +6525,19 @@ printf({fmt}, {expr1} ...) *printf()* arguments an error is given. Up to 18 arguments can be used. +pum_getpos() *pum_getpos()* + If the popup menu (see |ins-completion-menu|) is not visible, + returns an empty |Dictionary|, otherwise, returns a + |Dictionary| with the following keys: + height nr of items visible + width screen cells + row top screen row (0 first row) + col leftmost screen column (0 first col) + size total nr of items + scrollbar |TRUE| if visible + + The values are the same as in |v:event| during |CompleteChanged|. + pumvisible() *pumvisible()* Returns non-zero when the popup menu is visible, zero otherwise. See |ins-completion-menu|. -- cgit From c147806e23d0ade781b8a298924150fe8d5887ad Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 20 Dec 2019 00:02:36 -0500 Subject: vim-patch:8.2.0019: cannot number of lines of another buffer Problem: Cannot number of lines of another buffer. Solution: Add "linecount" to getbufinfo(). (Yasuhiro Matsumoto, closes vim/vim#5370) https://github.com/vim/vim/commit/a9e9679de3ef082ee29868ab404283dfc53258f2 --- runtime/doc/eval.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index d02ed54e27..77589b732d 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4138,6 +4138,8 @@ getbufinfo([{dict}]) hidden TRUE if the buffer is hidden. listed TRUE if the buffer is listed. lnum current line number in buffer. + linecount number of lines in the buffer (only + valid when loaded) loaded TRUE if the buffer is loaded. name full path to the file in the buffer. signs list of signs placed in the buffer. -- cgit From 1e693ac97d44f0cd0edcdb31d883d2a27c9d30ce Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 26 Dec 2019 23:21:13 -0500 Subject: vim-patch:8.1.1303: not possible to hide a balloon Problem: Not possible to hide a balloon. Solution: Hide the balloon when balloon_show() is called with an empty string or list. Add balloon_gettext(). https://github.com/vim/vim/commit/be0a2597ae0d9eb0b8a8a2fc9ae1784faa929844 --- runtime/doc/eval.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 77589b732d..c376e07cff 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -3770,6 +3770,8 @@ feedkeys({string} [, {mode}]) *feedkeys()* and "\..." notation |expr-quote|. For example, feedkeys("\") simulates pressing of the key. But feedkeys('\') pushes 5 characters. + A special code that might be useful is , it exits the + wait for a character without doing anything. ** {mode} is a String, which can contain these character flags: 'm' Remap keys. This is default. If {mode} is absent, -- cgit From 6c606c1191287752d174439874fc7e820272cc49 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 29 Dec 2019 00:44:11 -0500 Subject: vim-patch:8.1.1875: cannot get size and position of the popup menu Problem: Cannot get size and position of the popup menu. Solution: Add pum_getpos(). (Ben Jackson, closes vim/vim#4827) https://github.com/vim/vim/commit/e9bd57286a5cbb0e1ec18b5d194dc4af1bda9f3a https://github.com/neovim/neovim/pull/11562 backported the vim patch. This patch only updates the runtime/doc/ files to match Vim. --- runtime/doc/eval.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index c376e07cff..fecb8b5f74 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -3121,8 +3121,9 @@ complete_info([{what}]) the items listed in {what} are returned. Unsupported items in {what} are silently ignored. - To get the position of the popup menu, see |pum_getpos()|. It's - also available in |v:event| during the |CompleteChanged| event. + To get the position and size of the popup menu, see + |pum_getpos()|. It's also available in |v:event| during the + |CompleteChanged| event. Examples: > " Get all items -- cgit From 93e7c7e3bd30ae141b613e71a6a3a863e6064d91 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 10 Dec 2019 01:24:20 -0800 Subject: doc [ci skip] --- runtime/doc/eval.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index fecb8b5f74..960a42ecbf 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -3771,8 +3771,8 @@ feedkeys({string} [, {mode}]) *feedkeys()* and "\..." notation |expr-quote|. For example, feedkeys("\") simulates pressing of the key. But feedkeys('\') pushes 5 characters. - A special code that might be useful is , it exits the - wait for a character without doing anything. ** + The || keycode may be used to exit the + wait-for-character without doing anything. {mode} is a String, which can contain these character flags: 'm' Remap keys. This is default. If {mode} is absent, -- cgit From cbc8d72fde4b19176028490934ff7a447afe523c Mon Sep 17 00:00:00 2001 From: butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com> Date: Thu, 2 Jan 2020 06:06:11 -0800 Subject: tabpage: track last-used tabpage #11626 In a multi-window scenario, it is possible to return focus to the last accessed window via n_CTRL-W_p. However, in the case of a multi-tab scenario, there was previously no way to return focus to the last accessed *tab*. Here, that ability is added via n_g. Additionally, the index of the previous tab is exposed via tabpagenr('#'), mirroring the existing functionality of winnr('#'). --- runtime/doc/eval.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 960a42ecbf..67277d19dd 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -8591,8 +8591,12 @@ tabpagebuflist([{arg}]) *tabpagebuflist()* tabpagenr([{arg}]) *tabpagenr()* The result is a Number, which is the number of the current tab page. The first tab page has number 1. - When the optional argument is "$", the number of the last tab - page is returned (the tab page count). + The optional argument {arg} supports the following values: + $ the number of the last tab page (the tab page + count). + # the number of the last accessed tab page (where + |g| goes to). If there is no previous + tab page, 0 is returned. The number can be used with the |:tab| command. -- cgit From 92316849863bb2661ee5b4bb284f56163fed27ad Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 12 Jan 2020 23:41:55 -0800 Subject: doc [ci skip] #11656 --- runtime/doc/eval.txt | 59 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 25 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 67277d19dd..cd02449475 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2520,6 +2520,9 @@ and({expr}, {expr}) *and()* api_info() *api_info()* Returns Dictionary of |api-metadata|. + View it in a nice human-readable format: > + :lua print(vim.inspect(vim.fn.api_info())) + append({lnum}, {text}) *append()* When {text} is a |List|: Append each item of the |List| as a text line below line {lnum} in the current buffer. @@ -5453,35 +5456,41 @@ jobstart({cmd}[, {opts}]) *jobstart()* *jobstart-options* {opts} is a dictionary with these keys: - |on_stdout|: stdout event handler (function name or |Funcref|) - stdout_buffered : read stdout in |channel-buffered| mode. - |on_stderr|: stderr event handler (function name or |Funcref|) - stderr_buffered : read stderr in |channel-buffered| mode. - |on_exit| : exit event handler (function name or |Funcref|) - cwd : Working directory of the job; defaults to - |current-directory|. - env : A dict of strings to append (or replace see - |clear_env|) to the current environment. - clear_env: If set, use the exact values passed in |env| - rpc : If set, |msgpack-rpc| will be used to communicate - with the job over stdin and stdout. "on_stdout" is - then ignored, but "on_stderr" can still be used. - pty : If set, the job will be connected to a new pseudo - terminal and the job streams are connected to the - master file descriptor. "on_stderr" is ignored, - "on_stdout" receives all output. - - width : (pty only) Width of the terminal screen - height : (pty only) Height of the terminal screen - TERM : (pty only) $TERM environment variable - detach : (non-pty only) Detach the job process: it will - not be killed when Nvim exits. If the process - exits before Nvim, "on_exit" will be invoked. + clear_env: (boolean) `env` defines the job environment + exactly, instead of merging current environment. + cwd: (string, default=|current-directory|) Working + directory of the job. + detach: (boolean) Detach the job process: it will not be + killed when Nvim exits. If the process exits + before Nvim, `on_exit` will be invoked. + env: (dict) Map of environment variable name:value + pairs extending (or replacing if |clear_env|) + the current environment. + height: (number) Height of the `pty` terminal. + |on_exit|: (function) Callback invoked when the job exits. + |on_stdout|: (function) Callback invoked when the job emits + stdout data. + |on_stderr|: (function) Callback invoked when the job emits + stderr data. + pty: (boolean) Connect the job to a new pseudo + terminal, and its streams to the master file + descriptor. Then `on_stderr` is ignored, + `on_stdout` receives all output. + rpc: (boolean) Use |msgpack-rpc| to communicate with + the job over stdio. Then `on_stdout` is ignored, + but `on_stderr` can still be used. + stderr_buffered: (boolean) Collect data until EOF (stream closed) + before invoking `on_stderr`. |channel-buffered| + stdout_buffered: (boolean) Collect data until EOF (stream + closed) before invoking `on_stdout`. |channel-buffered| + TERM: (string) Sets the `pty` $TERM environment variable. + width: (number) Width of the `pty` terminal. {opts} is passed as |self| dictionary to the callback; the caller may set other keys to pass application-specific data. + Returns: - - The channel ID on success + - |channel-id| on success - 0 on invalid arguments - -1 if {cmd}[0] is not executable. See also |job-control|, |channel|, |msgpack-rpc|. -- cgit From 041ec8997a7f613f2ca13bf339c652f117fcb809 Mon Sep 17 00:00:00 2001 From: Billy Su Date: Mon, 20 Jan 2020 20:06:38 +0800 Subject: Fix f_jobstop() failed loudly The return value of jobstop() @return 1 for valid job id 0 for invalid id, including jobs have exited or stopped --- runtime/doc/eval.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index cd02449475..69b8b3cf39 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -5502,6 +5502,9 @@ jobstop({id}) *jobstop()* (if any) will be invoked. See |job-control|. + Returns 1 for valid job id, 0 for invalid id, including jobs have + exited or stopped. + jobwait({jobs}[, {timeout}]) *jobwait()* Waits for jobs and their |on_exit| handlers to complete. -- cgit From 31f31b40a8af67a3a55e85fa5dfa63d5a5999acc Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 29 Jan 2020 20:44:23 -0500 Subject: vim-patch:8.2.0077: settagstack() cannot truncate at current index Problem: settagstack() cannot truncate at current index. Solution: Add the "t" action. (Yegappan Lakshmanan, closes vim/vim#5417) https://github.com/vim/vim/commit/271fa08a35b8d320d3a40db4ddae83b698fdd4fb --- runtime/doc/eval.txt | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 69b8b3cf39..e0ce83f8d2 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -7550,11 +7550,21 @@ settagstack({nr}, {dict} [, {action}]) *settagstack()* {nr} can be the window number or the |window-ID|. For a list of supported items in {dict}, refer to - |gettagstack()| + |gettagstack()|. "curidx" takes effect before changing the tag + stack. *E962* - If {action} is not present or is set to 'r', then the tag - stack is replaced. If {action} is set to 'a', then new entries - from {dict} are pushed onto the tag stack. + How the tag stack is modified depends on the {action} + argument: + - If {action} is not present or is set to 'r', then the tag + stack is replaced. + - If {action} is set to 'a', then new entries from {dict} are + pushed (added) onto the tag stack. + - If {action} is set to 't', then all the entries from the + current entry in the tag stack or "curidx" in {dict} are + removed and then new entries are pushed to the stack. + + The current index is set to one after the length of the tag + stack after the modification. Returns zero for success, -1 for failure. -- cgit From 4813ad48cd12a03ca50c01ac1b20518bf4df57f2 Mon Sep 17 00:00:00 2001 From: erw7 Date: Mon, 20 May 2019 11:57:45 +0900 Subject: vim-patch:8.1.0027: difficult to make a plugin that feeds a line to a job Problem: Difficult to make a plugin that feeds a line to a job. Solution: Add the nitial code for the "prompt" buftype. https://github.com/vim/vim/commit/f273245f6433d5d43a5671306b520a3230c35787 --- runtime/doc/eval.txt | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index e0ce83f8d2..a9d9c83867 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2280,6 +2280,9 @@ pathshorten({expr}) String shorten directory names in a path pow({x}, {y}) Float {x} to the power of {y} prevnonblank({lnum}) Number line nr of non-blank line <= {lnum} printf({fmt}, {expr1}...) String format text +prompt_addtext({buf}, {expr}) none add text to a prompt buffer +prompt_setprompt({buf}, {text}) none set prompt text +prompt_setcallback({buf}, {expr}) none set prompt callback function pum_getpos() Dict position and size of pum if visible pumvisible() Number whether popup menu is visible pyeval({expr}) any evaluate |Python| expression @@ -2290,7 +2293,7 @@ range({expr} [, {max} [, {stride}]]) readdir({dir} [, {expr}]) List file names in {dir} selected by {expr} readfile({fname} [, {binary} [, {max}]]) List get list of lines from file {fname} -reg_executing() Number get the executing register name +reg_executing() String get the executing register name reg_recording() String get the recording register name reltime([{start} [, {end}]]) List get time value reltimefloat({time}) Float turn the time value into a Float @@ -4541,7 +4544,7 @@ getline({lnum} [, {end}]) from the current buffer. Example: > getline(1) < When {lnum} is a String that doesn't start with a - digit, line() is called to translate the String into a Number. + digit, |line()| is called to translate the String into a Number. To get the line under the cursor: > getline(".") < When {lnum} is smaller than 1 or bigger than the number of @@ -6541,6 +6544,40 @@ printf({fmt}, {expr1} ...) *printf()* of "%" items. If there are not sufficient or too many arguments an error is given. Up to 18 arguments can be used. +prompt_setprompt({buf}, {text}) *prompt_setprompt()* + Set prompt for buffer {buf} to {text}. You most likely want + {text} to end in a space. + The result is only visible if {buf} has 'buftype' set to + "prompt". Example: > + call prompt_setprompt(bufnr(''), 'command: ') + + +prompt_setcallback({buf}, {expr}) *prompt_setcallback()* + Set prompt callback for buffer {buf} to {expr}. This has only + effect if {buf} has 'buftype' set to "prompt". + The callback is invoked when pressing Enter. The current + buffer will always be the prompt buffer. A new line for a + prompt is added before invoking the callback, thus the prompt + for which the callback was invoked will be in the last but one + line. + If the callback wants to add text to the buffer, it must + insert it above the last line, since that is where the current + prompt is. This can also be done asynchronously. + The callback is invoked with one argument, which is the text + that was entered at the prompt. This can be an empty string + if the user only typed Enter. + Example: > + call prompt_setcallback(bufnr(''), function('s:TextEntered')) + func s:TextEntered(text) + if a:text == 'exit' || a:text == 'quit' + stopinsert + close + else + call append(line('$') - 1, 'Entered: "' . a:text . '"') + " Reset 'modified' to allow the buffer to be closed. + set nomodified + endif + endfunc pum_getpos() *pum_getpos()* If the popup menu (see |ins-completion-menu|) is not visible, @@ -6554,7 +6591,6 @@ pum_getpos() *pum_getpos()* scrollbar |TRUE| if visible The values are the same as in |v:event| during |CompleteChanged|. - pumvisible() *pumvisible()* Returns non-zero when the popup menu is visible, zero otherwise. See |ins-completion-menu|. -- cgit From fe395ae210914eeec0f8592268b1960cb1b819b8 Mon Sep 17 00:00:00 2001 From: erw7 Date: Thu, 23 May 2019 06:38:02 +0900 Subject: vim-patch:8.1.0069: cannot handle pressing CTRL-C in a prompt buffer Problem: Cannot handle pressing CTRL-C in a prompt buffer. Solution: Add prompt_setinterrupt(). https://github.com/vim/vim/commit/0e5979a6d491f68c4a8c86fab489016919329a6b --- runtime/doc/eval.txt | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index a9d9c83867..b0b684064e 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2281,8 +2281,9 @@ pow({x}, {y}) Float {x} to the power of {y} prevnonblank({lnum}) Number line nr of non-blank line <= {lnum} printf({fmt}, {expr1}...) String format text prompt_addtext({buf}, {expr}) none add text to a prompt buffer -prompt_setprompt({buf}, {text}) none set prompt text prompt_setcallback({buf}, {expr}) none set prompt callback function +prompt_setinterrupt({buf}, {text}) none set prompt interrupt function +prompt_setprompt({buf}, {text}) none set prompt text pum_getpos() Dict position and size of pum if visible pumvisible() Number whether popup menu is visible pyeval({expr}) any evaluate |Python| expression @@ -6544,17 +6545,11 @@ printf({fmt}, {expr1} ...) *printf()* of "%" items. If there are not sufficient or too many arguments an error is given. Up to 18 arguments can be used. -prompt_setprompt({buf}, {text}) *prompt_setprompt()* - Set prompt for buffer {buf} to {text}. You most likely want - {text} to end in a space. - The result is only visible if {buf} has 'buftype' set to - "prompt". Example: > - call prompt_setprompt(bufnr(''), 'command: ') - - prompt_setcallback({buf}, {expr}) *prompt_setcallback()* - Set prompt callback for buffer {buf} to {expr}. This has only + Set prompt callback for buffer {buf} to {expr}. When {expr} + is an empty string the callback is removed. This has only effect if {buf} has 'buftype' set to "prompt". + The callback is invoked when pressing Enter. The current buffer will always be the prompt buffer. A new line for a prompt is added before invoking the callback, thus the prompt @@ -6579,6 +6574,22 @@ prompt_setcallback({buf}, {expr}) *prompt_setcallback()* endif endfunc +prompt_setinterrupt({buf}, {expr}) *prompt_setinterrupt()* + Set a callback for buffer {buf} to {expr}. When {expr} is an + empty string the callback is removed. This has only effect if + {buf} has 'buftype' set to "prompt". + + This callback will be invoked when pressing CTRL-C in Insert + mode. Without setting a callback Vim will exit Insert mode, + as in any buffer. + +prompt_setprompt({buf}, {text}) *prompt_setprompt()* + Set prompt for buffer {buf} to {text}. You most likely want + {text} to end in a space. + The result is only visible if {buf} has 'buftype' set to + "prompt". Example: > + call prompt_setprompt(bufnr(''), 'command: ') + pum_getpos() *pum_getpos()* If the popup menu (see |ins-completion-menu|) is not visible, returns an empty |Dictionary|, otherwise, returns a @@ -6591,6 +6602,7 @@ pum_getpos() *pum_getpos()* scrollbar |TRUE| if visible The values are the same as in |v:event| during |CompleteChanged|. + pumvisible() *pumvisible()* Returns non-zero when the popup menu is visible, zero otherwise. See |ins-completion-menu|. -- cgit From aec3d7915c55fc0b7dc73f6186cf0ae45d416d33 Mon Sep 17 00:00:00 2001 From: erw7 Date: Sat, 25 May 2019 11:14:35 +0900 Subject: vim-patch:8.1.0091: MS-Windows: Cannot interrupt gdb when program is running Problem: MS-Windows: Cannot interrupt gdb when program is running. Solution: Add debugbreak() and use it in the terminal debugger. Respect 'modified' in a prompt buffer. https://github.com/vim/vim/commit/4551c0a9fcdbdef52836d4852686d54b5e47fdaf --- runtime/doc/eval.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index b0b684064e..b8739ff9b3 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2084,6 +2084,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 deepcopy({expr} [, {noref}]) any make a full copy of {expr} delete({fname} [, {flags}]) Number delete the file or directory {fname} deletebufline({expr}, {first}[, {last}]) @@ -3641,6 +3642,11 @@ exp({expr}) *exp()* :echo exp(-1) < 0.367879 +debugbreak({pid}) *debugbreak()* + Specifically used to interrupt a program being debugged. It + will cause process {pid} to get a SIGTRAP. Behavior for other + processes is undefined. See |terminal-debugger|. + {Sends a SIGINT to a process {pid} other than MS-Windows} expand({expr} [, {nosuf} [, {list}]]) *expand()* Expand wildcards and the following special keywords in {expr}. -- cgit From 7ed4837298414488e238763953d40a4c7f2d7976 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 20 Feb 2020 22:53:38 -0500 Subject: vim-patch:8.1.1122: char2nr() does not handle composing characters Problem: char2nr() does not handle composing characters. Solution: Add str2list() and list2str(). (Ozaki Kiichi, closes vim/vim#4190) https://github.com/vim/vim/commit/9d40128afd7fcd038ff6532722b55b1a8c189ce8 'utf8' optional param is noop unlike Vim. --- runtime/doc/eval.txt | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index b8739ff9b3..113a92d5e4 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2240,6 +2240,7 @@ libcallnr({lib}, {func}, {arg}) Number idem, but return a Number line({expr}) 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} +list2str({list} [, {utf8}]) String turn numbers in {list} into a String localtime() Number current time log({expr}) Float natural logarithm (base e) of {expr} log10({expr}) Float logarithm of Float {expr} to base 10 @@ -2394,6 +2395,8 @@ 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} str2float({expr}) Float convert String to Float +str2list({expr} [, {utf8}]) List convert each character of {expr} to + ASCII/UTF8 value str2nr({expr} [, {base}]) Number convert String to Number strchars({expr} [, {skipcc}]) Number character length of the String {expr} strcharpart({str}, {start} [, {len}]) @@ -5687,6 +5690,20 @@ lispindent({lnum}) *lispindent()* When {lnum} is invalid or Vim was not compiled the |+lispindent| feature, -1 is returned. +list2str({list} [, {utf8}]) *list2str()* + Convert each number in {list} to a character string can + concatenate them all. Examples: > + list2str([32]) returns " " + list2str([65, 66, 67]) returns "ABC" +< The same can be done (slowly) with: > + join(map(list, {nr, val -> nr2char(val)}), '') +< |str2list()| does the opposite. + + When {utf8} is omitted or zero, the current 'encoding' is used. + With {utf8} is 1, always return utf-8 characters. + With utf-8 composing characters work as expected: > + list2str([97, 769]) returns "á" +< localtime() *localtime()* Return the current time, measured as seconds since 1st Jan 1970. See also |strftime()| and |getftime()|. @@ -8197,6 +8214,18 @@ str2float({expr}) *str2float()* |substitute()|: > let f = str2float(substitute(text, ',', '', 'g')) +str2list({expr} [, {utf8}]) *str2list()* + Return a list containing the number values which represent + each character in String {expr}. Examples: > + str2list(" ") returns [32] + str2list("ABC") returns [65, 66, 67] +< |list2str()| does the opposite. + + When {utf8} is omitted or zero, the current 'encoding' is used. + With {utf8} set to 1, always treat the String as utf-8 + characters. With utf-8 composing characters are handled + properly: > + str2list("á") returns [97, 769] str2nr({expr} [, {base}]) *str2nr()* Convert string {expr} to a number. -- cgit From 3c12ee333a519c5be1d8f63d7978b483a51a3da7 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 2 Feb 2020 15:55:15 -0500 Subject: vim-patch:8.1.0619: :echomsg and :echoerr do not handle List and Dict Problem: :echomsg and :echoerr do not handle List and Dict like :echo does. (Daniel Hahler) Solution: Be more tolerant about the expression result type. https://github.com/vim/vim/commit/461a7fcfce3cd6414f990037e6468af3b5ccf119 Add lua functional tests for :echo,:echon,:echomsg,:echoerr because nvim did not port "test_" functions from Vim that modify internal state. Testing :echoerr via try/catch is sufficient. --- runtime/doc/eval.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 113a92d5e4..ce0218f1dd 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -10370,8 +10370,8 @@ text... The parsing works slightly different from |:echo|, more like |:execute|. All the expressions are first evaluated and concatenated before echoing anything. - The expressions must evaluate to a Number or String, a - Dictionary or List causes an error. + If expressions does not evaluate to a Number or + String, string() is used to turn it into a string. Uses the highlighting set by the |:echohl| command. Example: > :echomsg "It's a Zizzer Zazzer Zuzz, as you can plainly see." @@ -10382,7 +10382,7 @@ text... message in the |message-history|. When used in a script or function the line number will be added. Spaces are placed between the arguments as with the - :echo command. When used inside a try conditional, + |:echomsg| command. When used inside a try conditional, the message is raised as an error exception instead (see |try-echoerr|). Example: > -- cgit From eba8a9ca1d94f43b7fe2e92d5a2caa144dd68d0d Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 21 Feb 2020 22:05:59 -0500 Subject: vim-patch:8.1.1510: a plugin cannot easily expand a command like done internally Problem: A plugin cannot easily expand a command like done internally. Solution: Add the expandcmd() function. (Yegappan Lakshmanan, closes vim/vim#4514) https://github.com/vim/vim/commit/80dad48c5095d30873a42ec82628bdb213125d8e --- runtime/doc/eval.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index ce0218f1dd..c687d15689 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2110,6 +2110,7 @@ extend({expr1}, {expr2} [, {expr3}]) exp({expr}) Float exponential of {expr} expand({expr} [, {nosuf} [, {list}]]) any expand special keywords in {expr} +expandcmd({expr}) String expand {expr} like with `:edit` feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer filereadable({file}) Number |TRUE| if {file} is a readable file filewritable({file}) Number |TRUE| if {file} is a writable file @@ -3733,6 +3734,14 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()* See |glob()| for finding existing files. See |system()| for getting the raw output of an external command. +expandcmd({expr}) *expandcmd()* + Expand special items in {expr} like what is done for an Ex + command such as `:edit`. This expands special keywords, like + with |expand()|, and environment variables, anywhere in + {expr}. Returns the expanded string. + Example: > + :echo expandcmd('make %<.o') +< extend({expr1}, {expr2} [, {expr3}]) *extend()* {expr1} and {expr2} must be both |Lists| or both |Dictionaries|. -- cgit From 1caa85b677bc287883895558281d23e1fd55817e Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 25 Feb 2020 00:30:42 -0500 Subject: vim-patch:8.1.1466: not updating priority on existing sign Problem: Not updating priority on existing sign. Solution: Set the sign priority. Add a test. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/58a7f87c8653b4cb5b0794b6b88e2ec140d3d2c3 --- runtime/doc/eval.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index c687d15689..29c5c37bcd 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -7818,7 +7818,7 @@ sign_getplaced([{expr} [, {dict}]]) *sign_getplaced()* priority sign priority The returned signs in a buffer are ordered by their line - number. + number and priority. Returns an empty list on failure or if there are no placed signs. -- cgit From 978a6bcaf2b98b3c89381a3eacf642b4f61db033 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Sun, 22 Mar 2020 21:40:12 +0000 Subject: vim-patch:8.1.2225: the "last used" info of a buffer is under used Problem: The "last used" info of a buffer is under used. Solution: Add "lastused" to getbufinfo(). List buffers sorted by last-used field. (Andi Massimino, closes vim/vim#4722) https://github.com/vim/vim/commit/52410575be50d5c40bbe6380159df48cfc382ceb --- runtime/doc/eval.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 29c5c37bcd..4ff6269004 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4164,6 +4164,9 @@ getbufinfo([{dict}]) changed TRUE if the buffer is modified. changedtick number of changes made to the buffer. hidden TRUE if the buffer is hidden. + lastused timestamp in seconds, like + |localtime()|, when the buffer was + last used. listed TRUE if the buffer is listed. lnum current line number in buffer. linecount number of lines in the buffer (only -- cgit From d2766b06c8fc50d06765c5c607744cc6b5f5ef0a Mon Sep 17 00:00:00 2001 From: Hennadii Chernyshchyk Date: Tue, 5 May 2020 18:15:45 +0300 Subject: vim-patch:8.1.1120: cannot easily get directory entry matches #12222 Problem: Cannot easily get directory entry matches. Solution: Add the readdir() function. (Yasuhiro Matsumoto, closes vim/vim#2439) https://github.com/vim/vim/commit/543c9b1921d7605498b54afdef518e312f1b4515 closes #12212 --- runtime/doc/eval.txt | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 4ff6269004..6f13b34876 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -6688,6 +6688,33 @@ range({expr} [, {max} [, {stride}]]) *range()* range(2, -2, -1) " [2, 1, 0, -1, -2] range(0) " [] range(2, 0) " error! +< + *readdir()* +readdir({directory} [, {expr}]) + Return a list with file and directory names in {directory}. + + When {expr} is omitted all entries are included. + When {expr} is given, it is evaluated to check what to do: + If {expr} results in -1 then no further entries will + be handled. + If {expr} results in 0 then this entry will not be + added to the list. + If {expr} results in 1 then this entry will be added + to the list. + Each time {expr} is evaluated |v:val| is set to the entry name. + When {expr} is a function the name is passed as the argument. + For example, to get a list of files ending in ".txt": > + readdir(dirname, {n -> n =~ '.txt$'}) +< To skip hidden and backup files: > + readdir(dirname, {n -> n !~ '^\.\|\~$'}) + +< If you want to get a directory tree: > + function! s:tree(dir) + return {a:dir : map(readdir(a:dir), + \ {_, x -> isdirectory(x) ? + \ {x : s:tree(a:dir . '/' . x)} : x})} + endfunction + echo s:tree(".") < *readfile()* readfile({fname} [, {binary} [, {max}]]) @@ -6720,17 +6747,6 @@ readfile({fname} [, {binary} [, {max}]]) the result is an empty list. Also see |writefile()|. - *readdir()* -readdir({directory} [, {expr}]) - Return a list with file and directory names in {directory}. - You can also use |glob()| if you don't need to do complicated - things, such as limiting the number of matches. - - When {expr} is omitted all entries are included. - When {expr} is given, it is evaluated to check what to do: - If {expr} results in -1 then no further entries will - be handled. - reg_executing() *reg_executing()* Returns the single letter name of the register being executed. Returns an empty string when no register is being executed. -- cgit From d7d69fed18c2cd59d28ff12ef72f6fb2a98a7b66 Mon Sep 17 00:00:00 2001 From: Shougo Date: Sat, 16 May 2020 22:25:51 +0900 Subject: vim-patch:8.1.1084: cannot delete a match from another window (#12325) Problem: Cannot delete a match from another window. (Paul Jolly) Solution: Add window ID argument to matchdelete(), clearmatches(), getmatches() and setmatches(). (Andy Massimino, closes vim/vim#4178) https://github.com/vim/vim/commit/aff749145e23c0f20b5158d1d3a942948ed138e3 --- runtime/doc/eval.txt | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 6f13b34876..1992c34102 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2059,7 +2059,7 @@ chanclose({id}[, {stream}]) Number Closes a channel or one of its streams chansend({id}, {data}) Number Writes {data} to channel char2nr({expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr} cindent({lnum}) Number C indent for line {lnum} -clearmatches() none clear all matches +clearmatches([{win}]) none clear all matches col({expr}) Number column nr of cursor or mark complete({startcol}, {matches}) none set Insert mode completion complete_add({expr}) Number add completion match @@ -2167,7 +2167,7 @@ getjumplist([{winnr} [, {tabnr}]]) getline({lnum}) String line {lnum} of current buffer getline({lnum}, {end}) List lines {lnum} to {end} of current buffer getloclist({nr} [, {what}]) List list of location list items -getmatches() List list of current matches +getmatches([{win}]) List list of current matches getpid() Number process ID of Vim getpos({expr}) List position of cursor, mark, etc. getqflist([{what}]) List list of quickfix items @@ -2259,7 +2259,7 @@ matchadd({group}, {pattern}[, {priority}[, {id}]]) matchaddpos({group}, {list}[, {priority}[, {id}]]) Number highlight positions with {group} matcharg({nr}) List arguments of |:match| -matchdelete({id}) Number delete match identified by {id} +matchdelete({id} [, {win}]) Number delete match identified by {id} matchend({expr}, {pat}[, {start}[, {count}]]) Number position where {pat} ends in {expr} matchlist({expr}, {pat}[, {start}[, {count}]]) @@ -2352,7 +2352,7 @@ setfperm({fname}, {mode} Number set {fname} file permissions to {mode} setline({lnum}, {line}) Number set line {lnum} to {line} setloclist({nr}, {list}[, {action}[, {what}]]) Number modify location list using {list} -setmatches({list}) Number restore a list of matches +setmatches({list} [, {win}]) Number restore a list of matches setpos({expr}, {list}) Number set the {expr} position to {list} setqflist({list}[, {action}[, {what}]] Number modify quickfix list using {list} @@ -3005,9 +3005,11 @@ cindent({lnum}) *cindent()* When {lnum} is invalid -1 is returned. See |C-indenting|. -clearmatches() *clearmatches()* - Clears all matches previously defined for the current window - by |matchadd()| and the |:match| commands. +clearmatches([{win}]) *clearmatches()* + Clears all matches previously defined for the current window + by |matchadd()| and the |:match| commands. + If {win} is specified, use the window with this number or + window ID instead of the current window. *col()* col({expr}) The result is a Number, which is the byte index of the column @@ -4602,7 +4604,7 @@ getloclist({nr},[, {what}]) *getloclist()* field is applicable only when called from a location list window. -getmatches() *getmatches()* +getmatches([{win}]) *getmatches()* Returns a |List| with all matches previously defined for the current window by |matchadd()| and the |:match| commands. |getmatches()| is useful in combination with |setmatches()|, @@ -5943,7 +5945,7 @@ matchadd({group}, {pattern}[, {priority}[, {id} [, {dict}]]]) Defines a pattern to be highlighted in the current window (a "match"). It will be highlighted with {group}. Returns an identification number (ID), which can be used to delete the - match using |matchdelete()|. + match using |matchdelete()|. The ID is bound to the window. Matching is case sensitive and magic, unless case sensitivity or magicness are explicitly overridden in {pattern}. The 'magic', 'smartcase' and 'ignorecase' options are not used. @@ -6043,11 +6045,13 @@ matcharg({nr}) *matcharg()* Highlighting matches using the |:match| commands are limited to three matches. |matchadd()| does not have this limitation. -matchdelete({id}) *matchdelete()* *E802* *E803* +matchdelete({id} [, {win}) *matchdelete()* *E802* *E803* Deletes a match with ID {id} previously defined by |matchadd()| or one of the |:match| commands. Returns 0 if successful, otherwise -1. See example for |matchadd()|. All matches can be deleted in one operation by |clearmatches()|. + If {win} is specified, use the window with this number or + window ID instead of the current window. matchend({expr}, {pat} [, {start} [, {count}]]) *matchend()* Same as |match()|, but return the index of first character @@ -7420,11 +7424,13 @@ setloclist({nr}, {list}[, {action}[, {what}]]) *setloclist()* only the items listed in {what} are set. Refer to |setqflist()| for the list of supported keys in {what}. -setmatches({list}) *setmatches()* +setmatches({list} [, {win}]) *setmatches()* Restores a list of matches saved by |getmatches() for the current window|. Returns 0 if successful, otherwise -1. All current matches are cleared before the list is restored. See example for |getmatches()|. + If {win} is specified, use the window with this number or + window ID instead of the current window. *setpos()* setpos({expr}, {list}) -- cgit From e89462d9855eef7718d482df7f92da4279a1c5c3 Mon Sep 17 00:00:00 2001 From: kuuote <36663503+kuuote@users.noreply.github.com> Date: Mon, 25 May 2020 03:45:25 +0900 Subject: vim-patch:8.1.2233: cannot get the Vim command line arguments (#12117) Problem: Cannot get the Vim command line arguments. Solution: Add v:argv. (Dmitri Vereshchagin, closes vim/vim#1322) https://github.com/vim/vim/commit/69bf634858a2a75f2984e42b1e4017bc529a040a --- runtime/doc/eval.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 1992c34102..214d815006 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1423,6 +1423,10 @@ PREDEFINED VIM VARIABLES *vim-variable* *v:var* *v:* *E963* Some variables can be set by the user, but the type cannot be changed. + *v:argv* *argv-variable* +v:argv The command line arguments Vim was invoked with. This is a + list of strings. The first item is the Vim command. + *v:beval_col* *beval_col-variable* v:beval_col The number of the column, over which the mouse pointer is. This is the byte index in the |v:beval_lnum| line. @@ -2600,6 +2604,7 @@ argv([{nr} [, {winid}]) the whole |arglist| is returned. The {winid} argument specifies the window ID, see |argc()|. + For the Vim command line arguments see |v:argv|. assert_beeps({cmd}) *assert_beeps()* Run {cmd} and add an error message to |v:errors| if it does -- cgit From 8a1276005a1099187710bdcc19284de51a0aa89a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 3 Jun 2020 16:51:25 +0200 Subject: Add v:event.visual during `TextYankPost` (#12382) * propagate visual selection to textyankpost event * adapt tests * add docs * also adapt oldtest --- runtime/doc/eval.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/doc/eval.txt') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 214d815006..7f50769023 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1591,6 +1591,8 @@ v:event Dictionary of event data for the current |autocommand|. Valid operation. regtype Type of register as returned by |getregtype()|. + visual Selection is visual (as opposed to, + e.g., via motion). completed_item Current selected complete item on |CompleteChanged|, Is `{}` when no complete item selected. -- cgit From 909af2f3f10b49faf5f56ca866d316dbb0a94384 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 3 Jun 2020 01:36:26 -0400 Subject: vim-patch:8.2.0491: cannot recognize a