Mercurial > vim
comparison runtime/doc/eval.txt @ 9121:7350959e53c3 v7.4.1844
commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed May 25 21:23:21 2016 +0200
patch 7.4.1844
Problem: Using old function name in comment. More functions should start
with test_.
Solution: Rename function in comment. (Higashi Higashi) Rename
disable_char_avail_for_testing() to test_disable_char_avail().
And alloc_fail() to test_alloc_fail().
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 25 May 2016 21:30:08 +0200 |
parents | 0cc48b3cd884 |
children | 7363f5cc4cb8 |
comparison
equal
deleted
inserted
replaced
9120:2d179e86d3c0 | 9121:7350959e53c3 |
---|---|
1 *eval.txt* For Vim version 7.4. Last change: 2016 May 24 | 1 *eval.txt* For Vim version 7.4. Last change: 2016 May 25 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
1763 patch level (since this was introduced in patch 95, it's | 1763 patch level (since this was introduced in patch 95, it's |
1764 always 95 or bigger). Pc is always zero. | 1764 always 95 or bigger). Pc is always zero. |
1765 {only when compiled with |+termresponse| feature} | 1765 {only when compiled with |+termresponse| feature} |
1766 | 1766 |
1767 *v:testing* *testing-variable* | 1767 *v:testing* *testing-variable* |
1768 v:testing Must be set before using `garbagecollect_for_testing()`. | 1768 v:testing Must be set before using `test_garbagecollect_now()`. |
1769 | 1769 |
1770 *v:this_session* *this_session-variable* | 1770 *v:this_session* *this_session-variable* |
1771 v:this_session Full filename of the last loaded or saved session file. See | 1771 v:this_session Full filename of the last loaded or saved session file. See |
1772 |:mksession|. It is allowed to set this variable. When no | 1772 |:mksession|. It is allowed to set this variable. When no |
1773 session file has been saved, this variable is empty. | 1773 session file has been saved, this variable is empty. |
1833 USAGE RESULT DESCRIPTION ~ | 1833 USAGE RESULT DESCRIPTION ~ |
1834 | 1834 |
1835 abs({expr}) Float or Number absolute value of {expr} | 1835 abs({expr}) Float or Number absolute value of {expr} |
1836 acos({expr}) Float arc cosine of {expr} | 1836 acos({expr}) Float arc cosine of {expr} |
1837 add({list}, {item}) List append {item} to |List| {list} | 1837 add({list}, {item}) List append {item} to |List| {list} |
1838 alloc_fail({id}, {countdown}, {repeat}) | |
1839 none make memory allocation fail | |
1840 and({expr}, {expr}) Number bitwise AND | 1838 and({expr}, {expr}) Number bitwise AND |
1841 append({lnum}, {string}) Number append {string} below line {lnum} | 1839 append({lnum}, {string}) Number append {string} below line {lnum} |
1842 append({lnum}, {list}) Number append lines {list} below line {lnum} | 1840 append({lnum}, {list}) Number append lines {list} below line {lnum} |
1843 argc() Number number of files in the argument list | 1841 argc() Number number of files in the argument list |
1844 argidx() Number current index in the argument list | 1842 argidx() Number current index in the argument list |
1916 deepcopy({expr} [, {noref}]) any make a full copy of {expr} | 1914 deepcopy({expr} [, {noref}]) any make a full copy of {expr} |
1917 delete({fname} [, {flags}]) Number delete the file or directory {fname} | 1915 delete({fname} [, {flags}]) Number delete the file or directory {fname} |
1918 did_filetype() Number TRUE if FileType autocommand event used | 1916 did_filetype() Number TRUE if FileType autocommand event used |
1919 diff_filler({lnum}) Number diff filler lines about {lnum} | 1917 diff_filler({lnum}) Number diff filler lines about {lnum} |
1920 diff_hlID({lnum}, {col}) Number diff highlighting at {lnum}/{col} | 1918 diff_hlID({lnum}, {col}) Number diff highlighting at {lnum}/{col} |
1921 disable_char_avail_for_testing({expr}) | |
1922 none test without typeahead | |
1923 empty({expr}) Number TRUE if {expr} is empty | 1919 empty({expr}) Number TRUE if {expr} is empty |
1924 escape({string}, {chars}) String escape {chars} in {string} with '\' | 1920 escape({string}, {chars}) String escape {chars} in {string} with '\' |
1925 eval({string}) any evaluate {string} into its value | 1921 eval({string}) any evaluate {string} into its value |
1926 eventhandler() Number TRUE if inside an event handler | 1922 eventhandler() Number TRUE if inside an event handler |
1927 executable({expr}) Number 1 if executable {expr} exists | 1923 executable({expr}) Number 1 if executable {expr} exists |
2201 taglist({expr}) List list of tags matching {expr} | 2197 taglist({expr}) List list of tags matching {expr} |
2202 tagfiles() List tags files used | 2198 tagfiles() List tags files used |
2203 tan({expr}) Float tangent of {expr} | 2199 tan({expr}) Float tangent of {expr} |
2204 tanh({expr}) Float hyperbolic tangent of {expr} | 2200 tanh({expr}) Float hyperbolic tangent of {expr} |
2205 tempname() String name for a temporary file | 2201 tempname() String name for a temporary file |
2202 test_alloc_fail({id}, {countdown}, {repeat}) | |
2203 none make memory allocation fail | |
2204 test_disable_char_avail({expr}) none test without typeahead | |
2206 test_garbagecollect_now() none free memory right now for testing | 2205 test_garbagecollect_now() none free memory right now for testing |
2207 test_null_channel() Channel null value for testing | 2206 test_null_channel() Channel null value for testing |
2208 test_null_dict() Dict null value for testing | 2207 test_null_dict() Dict null value for testing |
2209 test_null_job() Job null value for testing | 2208 test_null_job() Job null value for testing |
2210 test_null_list() List null value for testing | 2209 test_null_list() List null value for testing |
2283 < Note that when {expr} is a |List| it is appended as a single | 2282 < Note that when {expr} is a |List| it is appended as a single |
2284 item. Use |extend()| to concatenate |Lists|. | 2283 item. Use |extend()| to concatenate |Lists|. |
2285 Use |insert()| to add an item at another position. | 2284 Use |insert()| to add an item at another position. |
2286 | 2285 |
2287 | 2286 |
2288 alloc_fail({id}, {countdown}, {repeat}) *alloc_fail()* | |
2289 This is for testing: If the memory allocation with {id} is | |
2290 called, then decrement {countdown}, and when it reaches zero | |
2291 let memory allocation fail {repeat} times. When {repeat} is | |
2292 smaller than one it fails one time. | |
2293 | |
2294 | |
2295 and({expr}, {expr}) *and()* | 2287 and({expr}, {expr}) *and()* |
2296 Bitwise AND on the two arguments. The arguments are converted | 2288 Bitwise AND on the two arguments. The arguments are converted |
2297 to a number. A List, Dict or Float argument causes an error. | 2289 to a number. A List, Dict or Float argument causes an error. |
2298 Example: > | 2290 Example: > |
2299 :let flag = and(bits, 0x80) | 2291 :let flag = and(bits, 0x80) |
3155 line, "'m" mark m, etc. | 3147 line, "'m" mark m, etc. |
3156 {col} is 1 for the leftmost column, {lnum} is 1 for the first | 3148 {col} is 1 for the leftmost column, {lnum} is 1 for the first |
3157 line. | 3149 line. |
3158 The highlight ID can be used with |synIDattr()| to obtain | 3150 The highlight ID can be used with |synIDattr()| to obtain |
3159 syntax information about the highlighting. | 3151 syntax information about the highlighting. |
3160 | |
3161 *disable_char_avail_for_testing()* | |
3162 disable_char_avail_for_testing({expr}) | |
3163 When {expr} is 1 the internal char_avail() function will | |
3164 return FALSE. When {expr} is 0 the char_avail() function will | |
3165 function normally. | |
3166 Only use this for a test where typeahead causes the test not | |
3167 to work. E.g., to trigger the CursorMovedI autocommand event. | |
3168 | 3152 |
3169 empty({expr}) *empty()* | 3153 empty({expr}) *empty()* |
3170 Return the Number 1 if {expr} is empty, zero otherwise. | 3154 Return the Number 1 if {expr} is empty, zero otherwise. |
3171 - A |List| or |Dictionary| is empty when it does not have any | 3155 - A |List| or |Dictionary| is empty when it does not have any |
3172 items. | 3156 items. |
7210 :exe "redir > " . tmpfile | 7194 :exe "redir > " . tmpfile |
7211 < For Unix, the file will be in a private directory |tempfile|. | 7195 < For Unix, the file will be in a private directory |tempfile|. |
7212 For MS-Windows forward slashes are used when the 'shellslash' | 7196 For MS-Windows forward slashes are used when the 'shellslash' |
7213 option is set or when 'shellcmdflag' starts with '-'. | 7197 option is set or when 'shellcmdflag' starts with '-'. |
7214 | 7198 |
7199 | |
7200 test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()* | |
7201 This is for testing: If the memory allocation with {id} is | |
7202 called, then decrement {countdown}, and when it reaches zero | |
7203 let memory allocation fail {repeat} times. When {repeat} is | |
7204 smaller than one it fails one time. | |
7205 | |
7206 | |
7207 *test_disable_char_avail()* | |
7208 test_disable_char_avail({expr}) | |
7209 When {expr} is 1 the internal char_avail() function will | |
7210 return FALSE. When {expr} is 0 the char_avail() function will | |
7211 function normally. | |
7212 Only use this for a test where typeahead causes the test not | |
7213 to work. E.g., to trigger the CursorMovedI autocommand event. | |
7215 | 7214 |
7216 test_garbagecollect_now() *test_garbagecollect_now()* | 7215 test_garbagecollect_now() *test_garbagecollect_now()* |
7217 Like garbagecollect(), but executed right away. This must | 7216 Like garbagecollect(), but executed right away. This must |
7218 only be called directly to avoid any structure to exist | 7217 only be called directly to avoid any structure to exist |
7219 internally, and |v:testing| must have been set before calling | 7218 internally, and |v:testing| must have been set before calling |