1- *eval.txt* For Vim version 8.1. Last change: 2019 Jun 10
1+ *eval.txt* For Vim version 8.1. Last change: 2019 Jun 22
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2183,7 +2183,7 @@ v:val Value of the current item of a |List| or |Dictionary|. Only
21832183
21842184 *v:version* *version-variable*
21852185v:version Version number of Vim: Major version number times 100 plus
2186- minor version number. Version 5.0 is 500. Version 5.1 (5.01)
2186+ minor version number. Version 5.0 is 500. Version 5.1
21872187 is 501. Read-only. "version" also works, for backwards
21882188 compatibility, unless |scriptversion| is 3 or higher.
21892189 Use |has()| to check if a certain patch was included, e.g.: >
@@ -2193,10 +2193,10 @@ v:version Version number of Vim: Major version number times 100 plus
21932193 completely different.
21942194
21952195 *v:versionlong* *versionlong-variable*
2196- v:versionlong Like v:version, but also including the patchlevel. Version
2197- 8.1 with patch 1234 has value 8011234. This can be used like
2198- this: >
2199- if v:versionlong >= 8011234
2196+ v:versionlong Like v:version, but also including the patchlevel in the last
2197+ four digits. Version 8.1 with patch 123 has value 8010123.
2198+ This can be used like this: >
2199+ if v:versionlong >= 8010123
22002200< However, if there are gaps in the list of patches included
22012201 this will not work well. This can happen if a recent patch
22022202 was included into an older version, e.g. for a security fix.
@@ -2741,6 +2741,7 @@ test_alloc_fail({id}, {countdown}, {repeat})
27412741test_autochdir() none enable 'autochdir' during startup
27422742test_feedinput({string}) none add key sequence to input buffer
27432743test_garbagecollect_now() none free memory right now for testing
2744+ test_garbagecollect_soon() none free memory soon for testing
27442745test_getvalue({string}) any get value of an internal variable
27452746test_ignore_error({expr}) none ignore a specific error
27462747test_null_blob() Blob null value for testing
@@ -8123,10 +8124,9 @@ setbufline({expr}, {lnum}, {text}) *setbufline()*
81238124
81248125 {lnum} is used like with |setline()|.
81258126 This works like |setline()| for the specified buffer.
8126- On success 0 is returned, on failure 1 is returned.
81278127
8128- If {expr} is not a valid buffer or {lnum} is not valid, an
8129- error message is given .
8128+ When {expr} is not a valid buffer or {lnum} is not valid then
8129+ 1 is returned. On success 0 is returned .
81308130
81318131setbufvar({expr}, {varname}, {val}) *setbufvar()*
81328132 Set option or local variable {varname} in buffer {expr} to
@@ -8884,7 +8884,7 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
88848884<
88858885sound_clear() *sound_clear()*
88868886 Stop playing all sounds.
8887- {only available when compiled with the +sound feature}
8887+ {only available when compiled with the | +sound| feature}
88888888
88898889 *sound_playevent()*
88908890sound_playevent({name} [, {callback}])
@@ -8893,20 +8893,25 @@ sound_playevent({name} [, {callback}])
88938893 are used. On Ubuntu they may be found in
88948894 /usr/share/sounds/freedesktop/stereo. Example: >
88958895 call sound_playevent('bell')
8896+ < On MS-Windows, {name} can be SystemAsterisk, SystemDefault,
8897+ SystemExclamation, SystemExit, SystemHand, SystemQuestion,
8898+ SystemStart, SystemWelcome, etc.
88968899
8897- < When {callback} is specified it is invoked when the sound is
8900+ When {callback} is specified it is invoked when the sound is
88988901 finished. The first argument is the sound ID, the second
88998902 argument is the status:
89008903 0 sound was played to the end
89018904 1 sound was interrupted
8902- 2 error occured after sound started
8905+ 2 error occurred after sound started
89038906 Example: >
89048907 func Callback(id, status)
89058908 echomsg "sound " .. a:id .. " finished with " .. a:status
89068909 endfunc
89078910 call sound_playevent('bell', 'Callback')
89088911
8909- < Returns the sound ID, which can be passed to `sound_stop ()` .
8912+ < MS-Windows: {callback} doesn't work for this function.
8913+
8914+ Returns the sound ID, which can be passed to `sound_stop()`.
89108915 Returns zero if the sound could not be played.
89118916 {only available when compiled with the |+sound| feature}
89128917
@@ -8922,6 +8927,10 @@ sound_playfile({path} [, {callback}])
89228927sound_stop({id}) *sound_stop()*
89238928 Stop playing sound {id}. {id} must be previously returned by
89248929 `sound_playevent()` or `sound_playfile()`.
8930+
8931+ On MS-Windows, this does not work for event sound started by
8932+ `sound_playevent()`. To stop event sounds, use `sound_clear()`.
8933+
89258934 {only available when compiled with the |+sound| feature}
89268935
89278936 *soundfold()*
@@ -10001,6 +10010,10 @@ test_garbagecollect_now() *test_garbagecollect_now()*
1000110010 internally, and |v:testing| must have been set before calling
1000210011 any function.
1000310012
10013+ test_garbagecollect_soon() *test_garbagecollect_soon()*
10014+ Set the flag to call the garbagecollector as if in the main
10015+ loop. Only to be used in tests.
10016+
1000410017test_getvalue({name}) *test_getvalue()*
1000510018 Get the value of an internal variable. These values for
1000610019 {name} are supported:
@@ -10064,6 +10077,8 @@ test_override({name}, {val}) *test_override()*
1006410077 fallback to the old engine
1006510078 no_query_mouse do not query the mouse position for "dec"
1006610079 terminals
10080+ no_wait_return set the "no_wait_return" flag. Not restored
10081+ with "ALL".
1006710082 ALL clear all overrides ({val} is not used)
1006810083
1006910084 "starting" is to be used when a test should behave like
@@ -11555,13 +11570,24 @@ text...
1155511570 If {marker} is not supplied, then "." is used as the
1155611571 default marker.
1155711572
11558- Any white space characters in the lines of text are
11559- preserved. If "trim" is specified before {marker} ,
11560- then all the leading indentation exactly matching the
11561- leading indentation before `let ` is stripped from the
11562- input lines and the line containing {marker} . Note
11563- that the difference between space and tab matters
11564- here.
11573+ Without "trim" any white space characters in the lines
11574+ of text are preserved. If "trim" is specified before
11575+ {marker}, then indentation is stripped so you can do: >
11576+ let text =<< trim END
11577+ if ok
11578+ echo 'done'
11579+ endif
11580+ END
11581+ < Results in: ["if ok", " echo 'done'", "endif"]
11582+ The marker must line up with "let" and the indentation
11583+ of the first line is removed from all the text lines.
11584+ Specifically: all the leading indentation exactly
11585+ matching the leading indentation of the first
11586+ non-empty text line is stripped from the input lines.
11587+ All leading indentation exactly matching the leading
11588+ indentation before `let` is stripped from the line
11589+ containing {marker}. Note that the difference between
11590+ space and tab matters here.
1156511591
1156611592 If {var-name} didn't exist yet, it is created.
1156711593 Cannot be followed by another command, but can be
@@ -11597,7 +11623,6 @@ text...
1159711623 # Number
1159811624 * Funcref
1159911625
11600-
1160111626:unl[et][!] {name} ... *:unlet* *:unl* *E108* *E795*
1160211627 Remove the internal variable {name}. Several variable
1160311628 names can be given, they are all removed. The name
@@ -11642,7 +11667,7 @@ text...
1164211667< This is useful if you want to make sure the variable
1164311668 is not modified.
1164411669 *E995*
11645- | :const | does not allow to for changing a variable. >
11670+ |:const| does not allow to for changing a variable: >
1164611671 :let x = 1
1164711672 :const x = 2 " Error!
1164811673< *E996*
0 commit comments