1- *eval.txt* For Vim version 8.0. Last change: 2018 Apr 20
1+ *eval.txt* For Vim version 8.0. Last change: 2018 Apr 28
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1548,10 +1548,12 @@ v:errmsg Last given error message. It's allowed to set this variable.
15481548 : ... handle error
15491549< "errmsg" also works, for backwards compatibility.
15501550
1551- *v:errors* *errors-variable*
1551+ *v:errors* *errors-variable* *assert-return *
15521552v:errors Errors found by assert functions, such as | assert_true() | .
15531553 This is a list of strings.
15541554 The assert functions append an item when an assert fails.
1555+ The return value indicates this: a one is returned if an item
1556+ was added to v:errors, otherwise zero is returned.
15551557 To remove old results make it empty: >
15561558 :let v:errors = []
15571559< If v:errors is set to anything but a list it is made an empty
@@ -2020,26 +2022,26 @@ argidx() Number current index in the argument list
20202022arglistid([{winnr} [, {tabnr} ]]) Number argument list id
20212023argv({nr} ) String {nr} entry of the argument list
20222024argv() List the argument list
2023- assert_beeps({cmd} ) none assert {cmd} causes a beep
2025+ assert_beeps({cmd} ) Number assert {cmd} causes a beep
20242026assert_equal({exp} , {act} [, {msg} ])
2025- none assert {exp} is equal to {act}
2027+ Number assert {exp} is equal to {act}
20262028assert_equalfile({fname-one} , {fname-two} )
2027- none assert file contents is equal
2029+ Number assert file contents is equal
20282030assert_exception({error} [, {msg} ])
2029- none assert {error} is in v:exception
2030- assert_fails({cmd} [, {error} ]) none assert {cmd} fails
2031+ Number assert {error} is in v:exception
2032+ assert_fails({cmd} [, {error} ]) Number assert {cmd} fails
20312033assert_false({actual} [, {msg} ])
2032- none assert {actual} is false
2034+ Number assert {actual} is false
20332035assert_inrange({lower} , {upper} , {actual} [, {msg} ])
2034- none assert {actual} is inside the range
2036+ Number assert {actual} is inside the range
20352037assert_match({pat} , {text} [, {msg} ])
2036- none assert {pat} matches {text}
2038+ Number assert {pat} matches {text}
20372039assert_notequal({exp} , {act} [, {msg} ])
2038- none assert {exp} is not equal {act}
2040+ Number assert {exp} is not equal {act}
20392041assert_notmatch({pat} , {text} [, {msg} ])
2040- none assert {pat} not matches {text}
2041- assert_report({msg} ) none report a test failure
2042- assert_true({actual} [, {msg} ]) none assert {actual} is true
2042+ Number assert {pat} not matches {text}
2043+ assert_report({msg} ) Number report a test failure
2044+ assert_true({actual} [, {msg} ]) Number assert {actual} is true
20432045asin({expr} ) Float arc sine of {expr}
20442046atan({expr} ) Float arc tangent of {expr}
20452047atan2({expr1} , {expr2} ) Float arc tangent of {expr1} / {expr2}
@@ -2593,12 +2595,13 @@ argv([{nr}]) The result is the {nr}th file in the argument list of the
25932595assert_beeps({cmd} ) *assert_beeps()*
25942596 Run {cmd} and add an error message to | v:errors | if it does
25952597 NOT produce a beep or visual bell.
2596- Also see | assert_fails() | .
2598+ Also see | assert_fails() | and | assert-return | .
25972599
25982600 *assert_equal()*
25992601assert_equal({expected} , {actual} [, {msg} ])
26002602 When {expected} and {actual} are not equal an error message is
2601- added to | v:errors | .
2603+ added to | v:errors | and 1 is returned. Otherwise zero is
2604+ returned | assert-return | .
26022605 There is no automatic conversion, the String "4" is different
26032606 from the Number 4. And the number 4 is different from the
26042607 Float 4.0. The value of 'ignorecase' is not used here, case
@@ -2614,13 +2617,14 @@ assert_equal({expected}, {actual} [, {msg}])
26142617assert_equalfile({fname-one} , {fname-two} )
26152618 When the files {fname-one} and {fname-two} do not contain
26162619 exactly the same text an error message is added to | v:errors | .
2620+ Also see | assert-return | .
26172621 When {fname-one} or {fname-two} does not exist the error will
26182622 mention that.
26192623 Mainly useful with | terminal-diff | .
26202624
26212625assert_exception({error} [, {msg} ]) *assert_exception()*
26222626 When v:exception does not contain the string {error} an error
2623- message is added to | v:errors | .
2627+ message is added to | v:errors | . Also see | assert-return | .
26242628 This can be used to assert that a command throws an exception.
26252629 Using the error number, followed by a colon, avoids problems
26262630 with translations: >
@@ -2633,14 +2637,15 @@ assert_exception({error} [, {msg}]) *assert_exception()*
26332637
26342638 assert_fails({cmd} [, {error} ]) *assert_fails()*
26352639 Run {cmd} and add an error message to | v:errors | if it does
2636- NOT produce an error.
2640+ NOT produce an error. Also see | assert-return | .
26372641 When {error} is given it must match in | v:errmsg | .
26382642 Note that beeping is not considered an error, and some failing
26392643 commands only beep. Use | assert_beeps() | for those.
26402644
26412645assert_false({actual} [, {msg} ]) *assert_false()*
26422646 When {actual} is not false an error message is added to
2643- | v:errors | , like with | assert_equal() | .
2647+ | v:errors | , like with | assert_equal() | .
2648+ Also see | assert-return | .
26442649 A value is false when it is zero. When {actual} is not a
26452650 number the assert fails.
26462651 When {msg} is omitted an error in the form
@@ -2649,15 +2654,15 @@ assert_false({actual} [, {msg}]) *assert_false()*
26492654assert_inrange({lower} , {upper} , {actual} [, {msg} ]) *assert_inrange()*
26502655 This asserts number values. When {actual} is lower than
26512656 {lower} or higher than {upper} an error message is added to
2652- | v:errors | .
2657+ | v:errors | . Also see | assert-return | .
26532658 When {msg} is omitted an error in the form
26542659 "Expected range {lower} - {upper} , but got {actual} " is
26552660 produced.
26562661
26572662 *assert_match()*
26582663assert_match({pattern} , {actual} [, {msg} ])
26592664 When {pattern} does not match {actual} an error message is
2660- added to | v:errors | .
2665+ added to | v:errors | . Also see | assert-return | .
26612666
26622667 {pattern} is used as with | =~ | : The matching is always done
26632668 like 'magic' was set and 'cpoptions' is empty, no matter what
@@ -2678,18 +2683,22 @@ assert_match({pattern}, {actual} [, {msg}])
26782683assert_notequal({expected} , {actual} [, {msg} ])
26792684 The opposite of `assert_equal ()` : add an error message to
26802685 | v:errors | when {expected} and {actual} are equal.
2686+ Also see | assert-return | .
26812687
26822688 *assert_notmatch()*
26832689assert_notmatch({pattern} , {actual} [, {msg} ])
26842690 The opposite of `assert_match ()` : add an error message to
26852691 | v:errors | when {pattern} matches {actual} .
2692+ Also see | assert-return | .
26862693
26872694assert_report({msg} ) *assert_report()*
26882695 Report a test failure directly, using {msg} .
2696+ Always returns one.
26892697
26902698assert_true({actual} [, {msg} ]) *assert_true()*
26912699 When {actual} is not true an error message is added to
26922700 | v:errors | , like with | assert_equal() | .
2701+ Also see | assert-return | .
26932702 A value is TRUE when it is a non-zero number. When {actual}
26942703 is not a number the assert fails.
26952704 When {msg} is omitted an error in the form "Expected True but
@@ -4728,6 +4737,7 @@ getqflist([{what}]) *getqflist()*
47284737 list item is a dictionary with these entries:
47294738 bufnr number of buffer that has the file name, use
47304739 bufname() to get the name
4740+ module module name
47314741 lnum line number in the buffer (first line is 1)
47324742 col column number (first column is 1)
47334743 vcol | TRUE | : "col" is visual column
@@ -4753,8 +4763,8 @@ getqflist([{what}]) *getqflist()*
47534763 returns only the items listed in {what} as a dictionary. The
47544764 following string items are supported in {what} :
47554765 changedtick get the total number of changes made
4756- to the list
4757- context get the context stored with | setqflist() |
4766+ to the list | quickfix-changedtick |
4767+ context get the | quickfix-context |
47584768 efm errorformat to use when parsing "lines". If
47594769 not present, then the 'errorformat' option
47604770 value is used.
@@ -4763,15 +4773,15 @@ getqflist([{what}]) *getqflist()*
47634773 current list or the list specified by "nr"
47644774 idx index of the current entry in the list
47654775 items quickfix list entries
4766- lines use 'errorformat' to extract items from a list
4767- of lines and return the resulting entries.
4768- Only a | List | type is accepted. The current
4769- quickfix list is not modified .
4776+ lines parse a list of lines using 'efm' and return
4777+ the resulting entries. Only a | List | type is
4778+ accepted. The current quickfix list is not
4779+ modified. See | quickfix-parse | .
47704780 nr get information for this quickfix list; zero
47714781 means the current quickfix list and "$" means
47724782 the last quickfix list
47734783 size number of entries in the quickfix list
4774- title get the list title
4784+ title get the list title | quickfix-title |
47754785 winid get the quickfix | window-ID |
47764786 all all of the above quickfix properties
47774787 Non-string items in {what} are ignored. To get the value of a
@@ -4789,7 +4799,7 @@ getqflist([{what}]) *getqflist()*
47894799 The returned dictionary contains the following entries:
47904800 changedtick total number of changes made to the
47914801 list | quickfix-changedtick |
4792- context context information stored with | setqflist() | .
4802+ context quickfix list context. See | quickfix-context |
47934803 If not present, set to "".
47944804 id quickfix list ID | quickfix-ID | . If not
47954805 present, set to 0.
@@ -4804,12 +4814,11 @@ getqflist([{what}]) *getqflist()*
48044814 to "".
48054815 winid quickfix | window-ID | . If not present, set to 0
48064816
4807- Examples: >
4817+ Examples (See also | getqflist-examples | ) : >
48084818 :echo getqflist({'all': 1})
48094819 :echo getqflist({'nr': 2, 'title': 1})
48104820 :echo getqflist({'lines' : ["F1:10:L10"]})
48114821<
4812-
48134822getreg([{regname} [, 1 [, {list} ]]]) *getreg()*
48144823 The result is a String, which is the contents of register
48154824 {regname} . Example: >
@@ -5392,17 +5401,20 @@ job_getchannel({job}) *job_getchannel()*
53925401<
53935402 {only available when compiled with the | +job | feature}
53945403
5395- job_info({job} ) *job_info()*
5404+ job_info([ {job} ]) *job_info()*
53965405 Returns a Dictionary with information about {job} :
53975406 "status" what | job_status() | returns
53985407 "channel" what | job_getchannel() | returns
5408+ "cmd" List of command arguments used to start the job
53995409 "process" process ID
54005410 "tty_in" terminal input name, empty when none
54015411 "tty_out" terminal output name, empty when none
54025412 "exitval" only valid when "status" is "dead"
54035413 "exit_cb" function to be called on exit
54045414 "stoponexit" | job-stoponexit |
54055415
5416+ Without any arguments, returns a List with all Job objects.
5417+
54065418job_setoptions({job} , {options} ) *job_setoptions()*
54075419 Change options for {job} . Supported are:
54085420 "stoponexit" | job-stoponexit |
@@ -7210,6 +7222,8 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
72107222 buffer
72117223 filename name of a file; only used when "bufnr" is not
72127224 present or it is invalid.
7225+ module name of a module; if given it will be used in
7226+ quickfix error window instead of the filename.
72137227 lnum line number in the file
72147228 pattern search pattern used to locate the error
72157229 col column number
@@ -7258,7 +7272,7 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
72587272 only the items listed in {what} are set. The first {list}
72597273 argument is ignored. The following items can be specified in
72607274 {what} :
7261- context any Vim type can be stored as a context
7275+ context quickfix list context. See | quickfix- context|
72627276 efm errorformat to use when parsing text from
72637277 "lines". If this is not present, then the
72647278 'errorformat' option value is used.
@@ -7280,10 +7294,10 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
72807294 list is modified, "id" should be used instead of "nr" to
72817295 specify the list.
72827296
7283- Examples: >
7297+ Examples (See also | setqflist-examples | ) : >
72847298 :call setqflist([], 'r', {'title': 'My search'})
72857299 :call setqflist([], 'r', {'nr': 2, 'title': 'Errors'})
7286- :call setqflist([], 'a', {'id':myid , 'lines':["F1:10:L10"]})
7300+ :call setqflist([], 'a', {'id':qfid , 'lines':["F1:10:L10"]})
72877301<
72887302 Returns zero for success, -1 for failure.
72897303
0 commit comments