Mercurial > vim
comparison runtime/doc/eval.txt @ 17456:e414281d8bb4 v8.1.1726
patch 8.1.1726: the eval.txt help file is too big
commit https://github.com/vim/vim/commit/ed997adaa1e9bd057ce732a73d933b739e9d0c30
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 21 16:42:00 2019 +0200
patch 8.1.1726: the eval.txt help file is too big
Problem: The eval.txt help file is too big.
Solution: Split off testing support to testing.txt. Move function details
to where the functionality is explained.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 21 Jul 2019 16:45:05 +0200 |
parents | 509542f1fffb |
children | 1e45331bd2ab |
comparison
equal
deleted
inserted
replaced
17455:4ae435e21326 | 17456:e414281d8bb4 |
---|---|
1 *eval.txt* For Vim version 8.1. Last change: 2019 Jul 19 | 1 *eval.txt* For Vim version 8.1. Last change: 2019 Jul 21 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
29 9. Examples |eval-examples| | 29 9. Examples |eval-examples| |
30 10. Vim script version |vimscript-version| | 30 10. Vim script version |vimscript-version| |
31 11. No +eval feature |no-eval-feature| | 31 11. No +eval feature |no-eval-feature| |
32 12. The sandbox |eval-sandbox| | 32 12. The sandbox |eval-sandbox| |
33 13. Textlock |textlock| | 33 13. Textlock |textlock| |
34 14. Testing |testing| | 34 |
35 Testing support is documented in |testing.txt|. | |
36 Profiling is documented at |profiling|. | |
35 | 37 |
36 ============================================================================== | 38 ============================================================================== |
37 1. Variables *variables* | 39 1. Variables *variables* |
38 | 40 |
39 1.1 Variable types ~ | 41 1.1 Variable types ~ |
2950 < Without the {nr} argument, or when {nr} is -1, a |List| with | 2952 < Without the {nr} argument, or when {nr} is -1, a |List| with |
2951 the whole |arglist| is returned. | 2953 the whole |arglist| is returned. |
2952 | 2954 |
2953 The {winid} argument specifies the window ID, see |argc()|. | 2955 The {winid} argument specifies the window ID, see |argc()|. |
2954 | 2956 |
2955 assert_beeps({cmd}) *assert_beeps()* | 2957 |
2956 Run {cmd} and add an error message to |v:errors| if it does | 2958 assert_ functions are documented here: |assert-functions| |
2957 NOT produce a beep or visual bell. | 2959 |
2958 Also see |assert_fails()| and |assert-return|. | |
2959 | |
2960 *assert_equal()* | |
2961 assert_equal({expected}, {actual} [, {msg}]) | |
2962 When {expected} and {actual} are not equal an error message is | |
2963 added to |v:errors| and 1 is returned. Otherwise zero is | |
2964 returned |assert-return|. | |
2965 There is no automatic conversion, the String "4" is different | |
2966 from the Number 4. And the number 4 is different from the | |
2967 Float 4.0. The value of 'ignorecase' is not used here, case | |
2968 always matters. | |
2969 When {msg} is omitted an error in the form "Expected | |
2970 {expected} but got {actual}" is produced. | |
2971 Example: > | |
2972 assert_equal('foo', 'bar') | |
2973 < Will result in a string to be added to |v:errors|: | |
2974 test.vim line 12: Expected 'foo' but got 'bar' ~ | |
2975 | |
2976 *assert_equalfile()* | |
2977 assert_equalfile({fname-one}, {fname-two}) | |
2978 When the files {fname-one} and {fname-two} do not contain | |
2979 exactly the same text an error message is added to |v:errors|. | |
2980 Also see |assert-return|. | |
2981 When {fname-one} or {fname-two} does not exist the error will | |
2982 mention that. | |
2983 Mainly useful with |terminal-diff|. | |
2984 | |
2985 assert_exception({error} [, {msg}]) *assert_exception()* | |
2986 When v:exception does not contain the string {error} an error | |
2987 message is added to |v:errors|. Also see |assert-return|. | |
2988 This can be used to assert that a command throws an exception. | |
2989 Using the error number, followed by a colon, avoids problems | |
2990 with translations: > | |
2991 try | |
2992 commandthatfails | |
2993 call assert_false(1, 'command should have failed') | |
2994 catch | |
2995 call assert_exception('E492:') | |
2996 endtry | |
2997 | |
2998 assert_fails({cmd} [, {error} [, {msg}]]) *assert_fails()* | |
2999 Run {cmd} and add an error message to |v:errors| if it does | |
3000 NOT produce an error. Also see |assert-return|. | |
3001 When {error} is given it must match in |v:errmsg|. | |
3002 Note that beeping is not considered an error, and some failing | |
3003 commands only beep. Use |assert_beeps()| for those. | |
3004 | |
3005 assert_false({actual} [, {msg}]) *assert_false()* | |
3006 When {actual} is not false an error message is added to | |
3007 |v:errors|, like with |assert_equal()|. | |
3008 Also see |assert-return|. | |
3009 A value is false when it is zero. When {actual} is not a | |
3010 number the assert fails. | |
3011 When {msg} is omitted an error in the form | |
3012 "Expected False but got {actual}" is produced. | |
3013 | |
3014 assert_inrange({lower}, {upper}, {actual} [, {msg}]) *assert_inrange()* | |
3015 This asserts number and |Float| values. When {actual} is lower | |
3016 than {lower} or higher than {upper} an error message is added | |
3017 to |v:errors|. Also see |assert-return|. | |
3018 When {msg} is omitted an error in the form | |
3019 "Expected range {lower} - {upper}, but got {actual}" is | |
3020 produced. | |
3021 | |
3022 *assert_match()* | |
3023 assert_match({pattern}, {actual} [, {msg}]) | |
3024 When {pattern} does not match {actual} an error message is | |
3025 added to |v:errors|. Also see |assert-return|. | |
3026 | |
3027 {pattern} is used as with |=~|: The matching is always done | |
3028 like 'magic' was set and 'cpoptions' is empty, no matter what | |
3029 the actual value of 'magic' or 'cpoptions' is. | |
3030 | |
3031 {actual} is used as a string, automatic conversion applies. | |
3032 Use "^" and "$" to match with the start and end of the text. | |
3033 Use both to match the whole text. | |
3034 | |
3035 When {msg} is omitted an error in the form | |
3036 "Pattern {pattern} does not match {actual}" is produced. | |
3037 Example: > | |
3038 assert_match('^f.*o$', 'foobar') | |
3039 < Will result in a string to be added to |v:errors|: | |
3040 test.vim line 12: Pattern '^f.*o$' does not match 'foobar' ~ | |
3041 | |
3042 *assert_notequal()* | |
3043 assert_notequal({expected}, {actual} [, {msg}]) | |
3044 The opposite of `assert_equal()`: add an error message to | |
3045 |v:errors| when {expected} and {actual} are equal. | |
3046 Also see |assert-return|. | |
3047 | |
3048 *assert_notmatch()* | |
3049 assert_notmatch({pattern}, {actual} [, {msg}]) | |
3050 The opposite of `assert_match()`: add an error message to | |
3051 |v:errors| when {pattern} matches {actual}. | |
3052 Also see |assert-return|. | |
3053 | |
3054 assert_report({msg}) *assert_report()* | |
3055 Report a test failure directly, using {msg}. | |
3056 Always returns one. | |
3057 | |
3058 assert_true({actual} [, {msg}]) *assert_true()* | |
3059 When {actual} is not true an error message is added to | |
3060 |v:errors|, like with |assert_equal()|. | |
3061 Also see |assert-return|. | |
3062 A value is TRUE when it is a non-zero number. When {actual} | |
3063 is not a number the assert fails. | |
3064 When {msg} is omitted an error in the form "Expected True but | |
3065 got {actual}" is produced. | |
3066 | 2960 |
3067 asin({expr}) *asin()* | 2961 asin({expr}) *asin()* |
3068 Return the arc sine of {expr} measured in radians, as a |Float| | 2962 Return the arc sine of {expr} measured in radians, as a |Float| |
3069 in the range of [-pi/2, pi/2]. | 2963 in the range of [-pi/2, pi/2]. |
3070 {expr} must evaluate to a |Float| or a |Number| in the range | 2964 {expr} must evaluate to a |Float| or a |Number| in the range |
3356 < -5.0 > | 3250 < -5.0 > |
3357 echo ceil(4.0) | 3251 echo ceil(4.0) |
3358 < 4.0 | 3252 < 4.0 |
3359 {only available when compiled with the |+float| feature} | 3253 {only available when compiled with the |+float| feature} |
3360 | 3254 |
3361 ch_canread({handle}) *ch_canread()* | 3255 |
3362 Return non-zero when there is something to read from {handle}. | 3256 ch_ functions are documented here: |channel-functions-details| |
3363 {handle} can be a Channel or a Job that has a Channel. | 3257 |
3364 | 3258 |
3365 This is useful to read from a channel at a convenient time, | |
3366 e.g. from a timer. | |
3367 | |
3368 Note that messages are dropped when the channel does not have | |
3369 a callback. Add a close callback to avoid that. | |
3370 | |
3371 {only available when compiled with the |+channel| feature} | |
3372 | |
3373 ch_close({handle}) *ch_close()* | |
3374 Close {handle}. See |channel-close|. | |
3375 {handle} can be a Channel or a Job that has a Channel. | |
3376 A close callback is not invoked. | |
3377 | |
3378 {only available when compiled with the |+channel| feature} | |
3379 | |
3380 ch_close_in({handle}) *ch_close_in()* | |
3381 Close the "in" part of {handle}. See |channel-close-in|. | |
3382 {handle} can be a Channel or a Job that has a Channel. | |
3383 A close callback is not invoked. | |
3384 | |
3385 {only available when compiled with the |+channel| feature} | |
3386 | |
3387 ch_evalexpr({handle}, {expr} [, {options}]) *ch_evalexpr()* | |
3388 Send {expr} over {handle}. The {expr} is encoded | |
3389 according to the type of channel. The function cannot be used | |
3390 with a raw channel. See |channel-use|. | |
3391 {handle} can be a Channel or a Job that has a Channel. | |
3392 *E917* | |
3393 {options} must be a Dictionary. It must not have a "callback" | |
3394 entry. It can have a "timeout" entry to specify the timeout | |
3395 for this specific request. | |
3396 | |
3397 ch_evalexpr() waits for a response and returns the decoded | |
3398 expression. When there is an error or timeout it returns an | |
3399 empty string. | |
3400 | |
3401 {only available when compiled with the |+channel| feature} | |
3402 | |
3403 ch_evalraw({handle}, {string} [, {options}]) *ch_evalraw()* | |
3404 Send {string} over {handle}. | |
3405 {handle} can be a Channel or a Job that has a Channel. | |
3406 | |
3407 Works like |ch_evalexpr()|, but does not encode the request or | |
3408 decode the response. The caller is responsible for the | |
3409 correct contents. Also does not add a newline for a channel | |
3410 in NL mode, the caller must do that. The NL in the response | |
3411 is removed. | |
3412 Note that Vim does not know when the text received on a raw | |
3413 channel is complete, it may only return the first part and you | |
3414 need to use |ch_readraw()| to fetch the rest. | |
3415 See |channel-use|. | |
3416 | |
3417 {only available when compiled with the |+channel| feature} | |
3418 | |
3419 ch_getbufnr({handle}, {what}) *ch_getbufnr()* | |
3420 Get the buffer number that {handle} is using for {what}. | |
3421 {handle} can be a Channel or a Job that has a Channel. | |
3422 {what} can be "err" for stderr, "out" for stdout or empty for | |
3423 socket output. | |
3424 Returns -1 when there is no buffer. | |
3425 {only available when compiled with the |+channel| feature} | |
3426 | |
3427 ch_getjob({channel}) *ch_getjob()* | |
3428 Get the Job associated with {channel}. | |
3429 If there is no job calling |job_status()| on the returned Job | |
3430 will result in "fail". | |
3431 | |
3432 {only available when compiled with the |+channel| and | |
3433 |+job| features} | |
3434 | |
3435 ch_info({handle}) *ch_info()* | |
3436 Returns a Dictionary with information about {handle}. The | |
3437 items are: | |
3438 "id" number of the channel | |
3439 "status" "open", "buffered" or "closed", like | |
3440 ch_status() | |
3441 When opened with ch_open(): | |
3442 "hostname" the hostname of the address | |
3443 "port" the port of the address | |
3444 "sock_status" "open" or "closed" | |
3445 "sock_mode" "NL", "RAW", "JSON" or "JS" | |
3446 "sock_io" "socket" | |
3447 "sock_timeout" timeout in msec | |
3448 When opened with job_start(): | |
3449 "out_status" "open", "buffered" or "closed" | |
3450 "out_mode" "NL", "RAW", "JSON" or "JS" | |
3451 "out_io" "null", "pipe", "file" or "buffer" | |
3452 "out_timeout" timeout in msec | |
3453 "err_status" "open", "buffered" or "closed" | |
3454 "err_mode" "NL", "RAW", "JSON" or "JS" | |
3455 "err_io" "out", "null", "pipe", "file" or "buffer" | |
3456 "err_timeout" timeout in msec | |
3457 "in_status" "open" or "closed" | |
3458 "in_mode" "NL", "RAW", "JSON" or "JS" | |
3459 "in_io" "null", "pipe", "file" or "buffer" | |
3460 "in_timeout" timeout in msec | |
3461 | |
3462 ch_log({msg} [, {handle}]) *ch_log()* | |
3463 Write {msg} in the channel log file, if it was opened with | |
3464 |ch_logfile()|. | |
3465 When {handle} is passed the channel number is used for the | |
3466 message. | |
3467 {handle} can be a Channel or a Job that has a Channel. The | |
3468 Channel must be open for the channel number to be used. | |
3469 | |
3470 ch_logfile({fname} [, {mode}]) *ch_logfile()* | |
3471 Start logging channel activity to {fname}. | |
3472 When {fname} is an empty string: stop logging. | |
3473 | |
3474 When {mode} is omitted or "a" append to the file. | |
3475 When {mode} is "w" start with an empty file. | |
3476 | |
3477 Use |ch_log()| to write log messages. The file is flushed | |
3478 after every message, on Unix you can use "tail -f" to see what | |
3479 is going on in real time. | |
3480 | |
3481 This function is not available in the |sandbox|. | |
3482 NOTE: the channel communication is stored in the file, be | |
3483 aware that this may contain confidential and privacy sensitive | |
3484 information, e.g. a password you type in a terminal window. | |
3485 | |
3486 | |
3487 ch_open({address} [, {options}]) *ch_open()* | |
3488 Open a channel to {address}. See |channel|. | |
3489 Returns a Channel. Use |ch_status()| to check for failure. | |
3490 | |
3491 {address} has the form "hostname:port", e.g., | |
3492 "localhost:8765". | |
3493 | |
3494 If {options} is given it must be a |Dictionary|. | |
3495 See |channel-open-options|. | |
3496 | |
3497 {only available when compiled with the |+channel| feature} | |
3498 | |
3499 ch_read({handle} [, {options}]) *ch_read()* | |
3500 Read from {handle} and return the received message. | |
3501 {handle} can be a Channel or a Job that has a Channel. | |
3502 For a NL channel this waits for a NL to arrive, except when | |
3503 there is nothing more to read (channel was closed). | |
3504 See |channel-more|. | |
3505 {only available when compiled with the |+channel| feature} | |
3506 | |
3507 ch_readblob({handle} [, {options}]) *ch_readblob()* | |
3508 Like ch_read() but reads binary data and returns a |Blob|. | |
3509 See |channel-more|. | |
3510 {only available when compiled with the |+channel| feature} | |
3511 | |
3512 ch_readraw({handle} [, {options}]) *ch_readraw()* | |
3513 Like ch_read() but for a JS and JSON channel does not decode | |
3514 the message. For a NL channel it does not block waiting for | |
3515 the NL to arrive, but otherwise works like ch_read(). | |
3516 See |channel-more|. | |
3517 {only available when compiled with the |+channel| feature} | |
3518 | |
3519 ch_sendexpr({handle}, {expr} [, {options}]) *ch_sendexpr()* | |
3520 Send {expr} over {handle}. The {expr} is encoded | |
3521 according to the type of channel. The function cannot be used | |
3522 with a raw channel. | |
3523 See |channel-use|. *E912* | |
3524 {handle} can be a Channel or a Job that has a Channel. | |
3525 | |
3526 {only available when compiled with the |+channel| feature} | |
3527 | |
3528 ch_sendraw({handle}, {expr} [, {options}]) *ch_sendraw()* | |
3529 Send |String| or |Blob| {expr} over {handle}. | |
3530 Works like |ch_sendexpr()|, but does not encode the request or | |
3531 decode the response. The caller is responsible for the | |
3532 correct contents. Also does not add a newline for a channel | |
3533 in NL mode, the caller must do that. The NL in the response | |
3534 is removed. | |
3535 See |channel-use|. | |
3536 | |
3537 {only available when compiled with the |+channel| feature} | |
3538 | |
3539 ch_setoptions({handle}, {options}) *ch_setoptions()* | |
3540 Set options on {handle}: | |
3541 "callback" the channel callback | |
3542 "timeout" default read timeout in msec | |
3543 "mode" mode for the whole channel | |
3544 See |ch_open()| for more explanation. | |
3545 {handle} can be a Channel or a Job that has a Channel. | |
3546 | |
3547 Note that changing the mode may cause queued messages to be | |
3548 lost. | |
3549 | |
3550 These options cannot be changed: | |
3551 "waittime" only applies to |ch_open()| | |
3552 | |
3553 ch_status({handle} [, {options}]) *ch_status()* | |
3554 Return the status of {handle}: | |
3555 "fail" failed to open the channel | |
3556 "open" channel can be used | |
3557 "buffered" channel can be read, not written to | |
3558 "closed" channel can not be used | |
3559 {handle} can be a Channel or a Job that has a Channel. | |
3560 "buffered" is used when the channel was closed but there is | |
3561 still data that can be obtained with |ch_read()|. | |
3562 | |
3563 If {options} is given it can contain a "part" entry to specify | |
3564 the part of the channel to return the status for: "out" or | |
3565 "err". For example, to get the error status: > | |
3566 ch_status(job, {"part": "err"}) | |
3567 < | |
3568 changenr() *changenr()* | 3259 changenr() *changenr()* |
3569 Return the number of the most recent change. This is the same | 3260 Return the number of the most recent change. This is the same |
3570 number as what is displayed with |:undolist| and can be used | 3261 number as what is displayed with |:undolist| and can be used |
3571 with the |:undo| command. | 3262 with the |:undo| command. |
3572 When a change was made it is the number of that change. After | 3263 When a change was made it is the number of that change. After |
6042 Example: > | 5733 Example: > |
6043 for [key, value] in items(mydict) | 5734 for [key, value] in items(mydict) |
6044 echo key . ': ' . value | 5735 echo key . ': ' . value |
6045 endfor | 5736 endfor |
6046 | 5737 |
6047 job_getchannel({job}) *job_getchannel()* | 5738 |
6048 Get the channel handle that {job} is using. | 5739 job_ functions are documented here: |job-functions-details| |
6049 To check if the job has no channel: > | 5740 |
6050 if string(job_getchannel()) == 'channel fail' | |
6051 < | |
6052 {only available when compiled with the |+job| feature} | |
6053 | |
6054 job_info([{job}]) *job_info()* | |
6055 Returns a Dictionary with information about {job}: | |
6056 "status" what |job_status()| returns | |
6057 "channel" what |job_getchannel()| returns | |
6058 "cmd" List of command arguments used to start the job | |
6059 "process" process ID | |
6060 "tty_in" terminal input name, empty when none | |
6061 "tty_out" terminal output name, empty when none | |
6062 "exitval" only valid when "status" is "dead" | |
6063 "exit_cb" function to be called on exit | |
6064 "stoponexit" |job-stoponexit| | |
6065 | |
6066 Only in Unix: | |
6067 "termsig" the signal which terminated the process | |
6068 (See |job_stop()| for the values) | |
6069 only valid when "status" is "dead" | |
6070 | |
6071 Only in MS-Windows: | |
6072 "tty_type" Type of virtual console in use. | |
6073 Values are "winpty" or "conpty". | |
6074 See 'termwintype'. | |
6075 | |
6076 Without any arguments, returns a List with all Job objects. | |
6077 | |
6078 job_setoptions({job}, {options}) *job_setoptions()* | |
6079 Change options for {job}. Supported are: | |
6080 "stoponexit" |job-stoponexit| | |
6081 "exit_cb" |job-exit_cb| | |
6082 | |
6083 job_start({command} [, {options}]) *job_start()* | |
6084 Start a job and return a Job object. Unlike |system()| and | |
6085 |:!cmd| this does not wait for the job to finish. | |
6086 To start a job in a terminal window see |term_start()|. | |
6087 | |
6088 If the job fails to start then |job_status()| on the returned | |
6089 Job object results in "fail" and none of the callbacks will be | |
6090 invoked. | |
6091 | |
6092 {command} can be a String. This works best on MS-Windows. On | |
6093 Unix it is split up in white-separated parts to be passed to | |
6094 execvp(). Arguments in double quotes can contain white space. | |
6095 | |
6096 {command} can be a List, where the first item is the executable | |
6097 and further items are the arguments. All items are converted | |
6098 to String. This works best on Unix. | |
6099 | |
6100 On MS-Windows, job_start() makes a GUI application hidden. If | |
6101 want to show it, Use |:!start| instead. | |
6102 | |
6103 The command is executed directly, not through a shell, the | |
6104 'shell' option is not used. To use the shell: > | |
6105 let job = job_start(["/bin/sh", "-c", "echo hello"]) | |
6106 < Or: > | |
6107 let job = job_start('/bin/sh -c "echo hello"') | |
6108 < Note that this will start two processes, the shell and the | |
6109 command it executes. If you don't want this use the "exec" | |
6110 shell command. | |
6111 | |
6112 On Unix $PATH is used to search for the executable only when | |
6113 the command does not contain a slash. | |
6114 | |
6115 The job will use the same terminal as Vim. If it reads from | |
6116 stdin the job and Vim will be fighting over input, that | |
6117 doesn't work. Redirect stdin and stdout to avoid problems: > | |
6118 let job = job_start(['sh', '-c', "myserver </dev/null >/dev/null"]) | |
6119 < | |
6120 The returned Job object can be used to get the status with | |
6121 |job_status()| and stop the job with |job_stop()|. | |
6122 | |
6123 Note that the job object will be deleted if there are no | |
6124 references to it. This closes the stdin and stderr, which may | |
6125 cause the job to fail with an error. To avoid this keep a | |
6126 reference to the job. Thus instead of: > | |
6127 call job_start('my-command') | |
6128 < use: > | |
6129 let myjob = job_start('my-command') | |
6130 < and unlet "myjob" once the job is not needed or is past the | |
6131 point where it would fail (e.g. when it prints a message on | |
6132 startup). Keep in mind that variables local to a function | |
6133 will cease to exist if the function returns. Use a | |
6134 script-local variable if needed: > | |
6135 let s:myjob = job_start('my-command') | |
6136 < | |
6137 {options} must be a Dictionary. It can contain many optional | |
6138 items, see |job-options|. | |
6139 | |
6140 {only available when compiled with the |+job| feature} | |
6141 | |
6142 job_status({job}) *job_status()* *E916* | |
6143 Returns a String with the status of {job}: | |
6144 "run" job is running | |
6145 "fail" job failed to start | |
6146 "dead" job died or was stopped after running | |
6147 | |
6148 On Unix a non-existing command results in "dead" instead of | |
6149 "fail", because a fork happens before the failure can be | |
6150 detected. | |
6151 | |
6152 If an exit callback was set with the "exit_cb" option and the | |
6153 job is now detected to be "dead" the callback will be invoked. | |
6154 | |
6155 For more information see |job_info()|. | |
6156 | |
6157 {only available when compiled with the |+job| feature} | |
6158 | |
6159 job_stop({job} [, {how}]) *job_stop()* | |
6160 Stop the {job}. This can also be used to signal the job. | |
6161 | |
6162 When {how} is omitted or is "term" the job will be terminated. | |
6163 For Unix SIGTERM is sent. On MS-Windows the job will be | |
6164 terminated forcedly (there is no "gentle" way). | |
6165 This goes to the process group, thus children may also be | |
6166 affected. | |
6167 | |
6168 Effect for Unix: | |
6169 "term" SIGTERM (default) | |
6170 "hup" SIGHUP | |
6171 "quit" SIGQUIT | |
6172 "int" SIGINT | |
6173 "kill" SIGKILL (strongest way to stop) | |
6174 number signal with that number | |
6175 | |
6176 Effect for MS-Windows: | |
6177 "term" terminate process forcedly (default) | |
6178 "hup" CTRL_BREAK | |
6179 "quit" CTRL_BREAK | |
6180 "int" CTRL_C | |
6181 "kill" terminate process forcedly | |
6182 Others CTRL_BREAK | |
6183 | |
6184 On Unix the signal is sent to the process group. This means | |
6185 that when the job is "sh -c command" it affects both the shell | |
6186 and the command. | |
6187 | |
6188 The result is a Number: 1 if the operation could be executed, | |
6189 0 if "how" is not supported on the system. | |
6190 Note that even when the operation was executed, whether the | |
6191 job was actually stopped needs to be checked with | |
6192 |job_status()|. | |
6193 | |
6194 If the status of the job is "dead", the signal will not be | |
6195 sent. This is to avoid to stop the wrong job (esp. on Unix, | |
6196 where process numbers are recycled). | |
6197 | |
6198 When using "kill" Vim will assume the job will die and close | |
6199 the channel. | |
6200 | |
6201 {only available when compiled with the |+job| feature} | |
6202 | 5741 |
6203 join({list} [, {sep}]) *join()* | 5742 join({list} [, {sep}]) *join()* |
6204 Join the items in {list} together into one String. | 5743 Join the items in {list} together into one String. |
6205 When {sep} is specified it is put in between the items. If | 5744 When {sep} is specified it is put in between the items. If |
6206 {sep} is omitted a single space is used. | 5745 {sep} is omitted a single space is used. |
7331 {text} to end in a space. | 6870 {text} to end in a space. |
7332 The result is only visible if {buf} has 'buftype' set to | 6871 The result is only visible if {buf} has 'buftype' set to |
7333 "prompt". Example: > | 6872 "prompt". Example: > |
7334 call prompt_setprompt(bufnr(''), 'command: ') | 6873 call prompt_setprompt(bufnr(''), 'command: ') |
7335 < | 6874 < |
7336 *prop_add()* *E965* | 6875 prop_ functions are documented here: |text-prop-functions|. |
7337 prop_add({lnum}, {col}, {props}) | |
7338 Attach a text property at position {lnum}, {col}. {col} is | |
7339 counted in bytes, use one for the first column. | |
7340 If {lnum} is invalid an error is given. *E966* | |
7341 If {col} is invalid an error is given. *E964* | |
7342 | |
7343 {props} is a dictionary with these fields: | |
7344 length length of text in bytes, can only be used | |
7345 for a property that does not continue in | |
7346 another line; can be zero | |
7347 end_lnum line number for the end of text | |
7348 end_col column just after the text; not used when | |
7349 "length" is present; when {col} and "end_col" | |
7350 are equal, and "end_lnum" is omitted or equal | |
7351 to {lnum}, this is a zero-width text property | |
7352 bufnr buffer to add the property to; when omitted | |
7353 the current buffer is used | |
7354 id user defined ID for the property; when omitted | |
7355 zero is used | |
7356 type name of the text property type | |
7357 All fields except "type" are optional. | |
7358 | |
7359 It is an error when both "length" and "end_lnum" or "end_col" | |
7360 are given. Either use "length" or "end_col" for a property | |
7361 within one line, or use "end_lnum" and "end_col" for a | |
7362 property that spans more than one line. | |
7363 When neither "length" nor "end_col" are given the property | |
7364 will be zero-width. That means it will not be highlighted but | |
7365 will move with the text, as a kind of mark. | |
7366 The property can end exactly at the last character of the | |
7367 text, or just after it. In the last case, if text is appended | |
7368 to the line, the text property size will increase, also when | |
7369 the property type does not have "end_incl" set. | |
7370 | |
7371 "type" will first be looked up in the buffer the property is | |
7372 added to. When not found, the global property types are used. | |
7373 If not found an error is given. | |
7374 | |
7375 See |text-properties| for information about text properties. | |
7376 | |
7377 | |
7378 prop_clear({lnum} [, {lnum-end} [, {props}]]) *prop_clear()* | |
7379 Remove all text properties from line {lnum}. | |
7380 When {lnum-end} is given, remove all text properties from line | |
7381 {lnum} to {lnum-end} (inclusive). | |
7382 | |
7383 When {props} contains a "bufnr" item use this buffer, | |
7384 otherwise use the current buffer. | |
7385 | |
7386 See |text-properties| for information about text properties. | |
7387 | |
7388 *prop_find()* | |
7389 prop_find({props} [, {direction}]) | |
7390 NOT IMPLEMENTED YET | |
7391 Search for a text property as specified with {props}: | |
7392 id property with this ID | |
7393 type property with this type name | |
7394 bufnr buffer to search in; when present a | |
7395 start position with "lnum" and "col" | |
7396 must be given; when omitted the | |
7397 current buffer is used | |
7398 lnum start in this line (when omitted start | |
7399 at the cursor) | |
7400 col start at this column (when omitted | |
7401 and "lnum" is given: use column 1, | |
7402 otherwise start at the cursor) | |
7403 skipstart do not look for a match at the start | |
7404 position | |
7405 | |
7406 {direction} can be "f" for forward and "b" for backward. When | |
7407 omitted forward search is performed. | |
7408 | |
7409 If a match is found then a Dict is returned with the entries | |
7410 as with prop_list(), and additionally an "lnum" entry. | |
7411 If no match is found then an empty Dict is returned. | |
7412 | |
7413 See |text-properties| for information about text properties. | |
7414 | |
7415 | |
7416 prop_list({lnum} [, {props}]) *prop_list()* | |
7417 Return a List with all text properties in line {lnum}. | |
7418 | |
7419 When {props} contains a "bufnr" item, use this buffer instead | |
7420 of the current buffer. | |
7421 | |
7422 The properties are ordered by starting column and priority. | |
7423 Each property is a Dict with these entries: | |
7424 col starting column | |
7425 length length in bytes, one more if line break is | |
7426 included | |
7427 id property ID | |
7428 type name of the property type, omitted if | |
7429 the type was deleted | |
7430 start when TRUE property starts in this line | |
7431 end when TRUE property ends in this line | |
7432 | |
7433 When "start" is zero the property started in a previous line, | |
7434 the current one is a continuation. | |
7435 When "end" is zero the property continues in the next line. | |
7436 The line break after this line is included. | |
7437 | |
7438 See |text-properties| for information about text properties. | |
7439 | |
7440 | |
7441 *prop_remove()* *E968* | |
7442 prop_remove({props} [, {lnum} [, {lnum-end}]]) | |
7443 Remove a matching text property from line {lnum}. When | |
7444 {lnum-end} is given, remove matching text properties from line | |
7445 {lnum} to {lnum-end} (inclusive). | |
7446 When {lnum} is omitted remove matching text properties from | |
7447 all lines. | |
7448 | |
7449 {props} is a dictionary with these fields: | |
7450 id remove text properties with this ID | |
7451 type remove text properties with this type name | |
7452 bufnr use this buffer instead of the current one | |
7453 all when TRUE remove all matching text properties, | |
7454 not just the first one | |
7455 A property matches when either "id" or "type" matches. | |
7456 If buffer "bufnr" does not exist you get an error message. | |
7457 If buffer "bufnr" is not loaded then nothing happens. | |
7458 | |
7459 Returns the number of properties that were removed. | |
7460 | |
7461 See |text-properties| for information about text properties. | |
7462 | |
7463 | |
7464 prop_type_add({name}, {props}) *prop_type_add()* *E969* *E970* | |
7465 Add a text property type {name}. If a property type with this | |
7466 name already exists an error is given. | |
7467 {props} is a dictionary with these optional fields: | |
7468 bufnr define the property only for this buffer; this | |
7469 avoids name collisions and automatically | |
7470 clears the property types when the buffer is | |
7471 deleted. | |
7472 highlight name of highlight group to use | |
7473 priority when a character has multiple text | |
7474 properties the one with the highest priority | |
7475 will be used; negative values can be used, the | |
7476 default priority is zero | |
7477 combine when TRUE combine the highlight with any | |
7478 syntax highlight; when omitted or FALSE syntax | |
7479 highlight will not be used | |
7480 start_incl when TRUE inserts at the start position will | |
7481 be included in the text property | |
7482 end_incl when TRUE inserts at the end position will be | |
7483 included in the text property | |
7484 | |
7485 See |text-properties| for information about text properties. | |
7486 | |
7487 | |
7488 prop_type_change({name}, {props}) *prop_type_change()* | |
7489 Change properties of an existing text property type. If a | |
7490 property with this name does not exist an error is given. | |
7491 The {props} argument is just like |prop_type_add()|. | |
7492 | |
7493 See |text-properties| for information about text properties. | |
7494 | |
7495 | |
7496 prop_type_delete({name} [, {props}]) *prop_type_delete()* | |
7497 Remove the text property type {name}. When text properties | |
7498 using the type {name} are still in place, they will not have | |
7499 an effect and can no longer be removed by name. | |
7500 | |
7501 {props} can contain a "bufnr" item. When it is given, delete | |
7502 a property type from this buffer instead of from the global | |
7503 property types. | |
7504 | |
7505 When text property type {name} is not found there is no error. | |
7506 | |
7507 See |text-properties| for information about text properties. | |
7508 | |
7509 | |
7510 prop_type_get([{name} [, {props}]) *prop_type_get()* | |
7511 Returns the properties of property type {name}. This is a | |
7512 dictionary with the same fields as was given to | |
7513 prop_type_add(). | |
7514 When the property type {name} does not exist, an empty | |
7515 dictionary is returned. | |
7516 | |
7517 {props} can contain a "bufnr" item. When it is given, use | |
7518 this buffer instead of the global property types. | |
7519 | |
7520 See |text-properties| for information about text properties. | |
7521 | |
7522 | |
7523 prop_type_list([{props}]) *prop_type_list()* | |
7524 Returns a list with all property type names. | |
7525 | |
7526 {props} can contain a "bufnr" item. When it is given, use | |
7527 this buffer instead of the global property types. | |
7528 | |
7529 See |text-properties| for information about text properties. | |
7530 | |
7531 | 6876 |
7532 pumvisible() *pumvisible()* | 6877 pumvisible() *pumvisible()* |
7533 Returns non-zero when the popup menu is visible, zero | 6878 Returns non-zero when the popup menu is visible, zero |
7534 otherwise. See |ins-completion-menu|. | 6879 otherwise. See |ins-completion-menu|. |
7535 This can be used to avoid some things that would remove the | 6880 This can be used to avoid some things that would remove the |
8635 When there is one argument {col} this is used as column number | 7980 When there is one argument {col} this is used as column number |
8636 for which to return the 'shiftwidth' value. This matters for the | 7981 for which to return the 'shiftwidth' value. This matters for the |
8637 'vartabstop' feature. If the 'vartabstop' setting is enabled and | 7982 'vartabstop' feature. If the 'vartabstop' setting is enabled and |
8638 no {col} argument is given, column 1 will be assumed. | 7983 no {col} argument is given, column 1 will be assumed. |
8639 | 7984 |
8640 sign_define({name} [, {dict}]) *sign_define()* | 7985 sign_ functions are documented here: |sign-functions-details| |
8641 sign_define({list}) | 7986 |
8642 Define a new sign named {name} or modify the attributes of an | 7987 |
8643 existing sign. This is similar to the |:sign-define| command. | |
8644 | |
8645 Prefix {name} with a unique text to avoid name collisions. | |
8646 There is no {group} like with placing signs. | |
8647 | |
8648 The {name} can be a String or a Number. The optional {dict} | |
8649 argument specifies the sign attributes. The following values | |
8650 are supported: | |
8651 icon full path to the bitmap file for the sign. | |
8652 linehl highlight group used for the whole line the | |
8653 sign is placed in. | |
8654 text text that is displayed when there is no icon | |
8655 or the GUI is not being used. | |
8656 texthl highlight group used for the text item | |
8657 | |
8658 If the sign named {name} already exists, then the attributes | |
8659 of the sign are updated. | |
8660 | |
8661 The one argument {list} can be used to define a list of signs. | |
8662 Each list item is a dictionary with the above items in {dict} | |
8663 and a 'name' item for the sign name. | |
8664 | |
8665 Returns 0 on success and -1 on failure. When the one argument | |
8666 {list} is used, then returns a List of values one for each | |
8667 defined sign. | |
8668 | |
8669 Examples: > | |
8670 call sign_define("mySign", { | |
8671 \ "text" : "=>", | |
8672 \ "texthl" : "Error", | |
8673 \ "linehl" : "Search"}) | |
8674 call sign_define([ | |
8675 \ {'name' : 'sign1', | |
8676 \ 'text' : '=>'}, | |
8677 \ {'name' : 'sign2', | |
8678 \ 'text' : '!!'} | |
8679 \ ]) | |
8680 < | |
8681 sign_getdefined([{name}]) *sign_getdefined()* | |
8682 Get a list of defined signs and their attributes. | |
8683 This is similar to the |:sign-list| command. | |
8684 | |
8685 If the {name} is not supplied, then a list of all the defined | |
8686 signs is returned. Otherwise the attribute of the specified | |
8687 sign is returned. | |
8688 | |
8689 Each list item in the returned value is a dictionary with the | |
8690 following entries: | |
8691 icon full path to the bitmap file of the sign | |
8692 linehl highlight group used for the whole line the | |
8693 sign is placed in. | |
8694 name name of the sign | |
8695 text text that is displayed when there is no icon | |
8696 or the GUI is not being used. | |
8697 texthl highlight group used for the text item | |
8698 | |
8699 Returns an empty List if there are no signs and when {name} is | |
8700 not found. | |
8701 | |
8702 Examples: > | |
8703 " Get a list of all the defined signs | |
8704 echo sign_getdefined() | |
8705 | |
8706 " Get the attribute of the sign named mySign | |
8707 echo sign_getdefined("mySign") | |
8708 < | |
8709 sign_getplaced([{expr} [, {dict}]]) *sign_getplaced()* | |
8710 Return a list of signs placed in a buffer or all the buffers. | |
8711 This is similar to the |:sign-place-list| command. | |
8712 | |
8713 If the optional buffer name {expr} is specified, then only the | |
8714 list of signs placed in that buffer is returned. For the use | |
8715 of {expr}, see |bufname()|. The optional {dict} can contain | |
8716 the following entries: | |
8717 group select only signs in this group | |
8718 id select sign with this identifier | |
8719 lnum select signs placed in this line. For the use | |
8720 of {lnum}, see |line()|. | |
8721 If {group} is '*', then signs in all the groups including the | |
8722 global group are returned. If {group} is not supplied or is an | |
8723 empty string, then only signs in the global group are | |
8724 returned. If no arguments are supplied, then signs in the | |
8725 global group placed in all the buffers are returned. | |
8726 See |sign-group|. | |
8727 | |
8728 Each list item in the returned value is a dictionary with the | |
8729 following entries: | |
8730 bufnr number of the buffer with the sign | |
8731 signs list of signs placed in {bufnr}. Each list | |
8732 item is a dictionary with the below listed | |
8733 entries | |
8734 | |
8735 The dictionary for each sign contains the following entries: | |
8736 group sign group. Set to '' for the global group. | |
8737 id identifier of the sign | |
8738 lnum line number where the sign is placed | |
8739 name name of the defined sign | |
8740 priority sign priority | |
8741 | |
8742 The returned signs in a buffer are ordered by their line | |
8743 number and priority. | |
8744 | |
8745 Returns an empty list on failure or if there are no placed | |
8746 signs. | |
8747 | |
8748 Examples: > | |
8749 " Get a List of signs placed in eval.c in the | |
8750 " global group | |
8751 echo sign_getplaced("eval.c") | |
8752 | |
8753 " Get a List of signs in group 'g1' placed in eval.c | |
8754 echo sign_getplaced("eval.c", {'group' : 'g1'}) | |
8755 | |
8756 " Get a List of signs placed at line 10 in eval.c | |
8757 echo sign_getplaced("eval.c", {'lnum' : 10}) | |
8758 | |
8759 " Get sign with identifier 10 placed in a.py | |
8760 echo sign_getplaced("a.py", {'id' : 10}) | |
8761 | |
8762 " Get sign with id 20 in group 'g1' placed in a.py | |
8763 echo sign_getplaced("a.py", {'group' : 'g1', | |
8764 \ 'id' : 20}) | |
8765 | |
8766 " Get a List of all the placed signs | |
8767 echo sign_getplaced() | |
8768 < | |
8769 *sign_jump()* | |
8770 sign_jump({id}, {group}, {expr}) | |
8771 Open the buffer {expr} or jump to the window that contains | |
8772 {expr} and position the cursor at sign {id} in group {group}. | |
8773 This is similar to the |:sign-jump| command. | |
8774 | |
8775 For the use of {expr}, see |bufname()|. | |
8776 | |
8777 Returns the line number of the sign. Returns -1 if the | |
8778 arguments are invalid. | |
8779 | |
8780 Example: > | |
8781 " Jump to sign 10 in the current buffer | |
8782 call sign_jump(10, '', '') | |
8783 < | |
8784 *sign_place()* | |
8785 sign_place({id}, {group}, {name}, {expr} [, {dict}]) | |
8786 Place the sign defined as {name} at line {lnum} in file or | |
8787 buffer {expr} and assign {id} and {group} to sign. This is | |
8788 similar to the |:sign-place| command. | |
8789 | |
8790 If the sign identifier {id} is zero, then a new identifier is | |
8791 allocated. Otherwise the specified number is used. {group} is | |
8792 the sign group name. To use the global sign group, use an | |
8793 empty string. {group} functions as a namespace for {id}, thus | |
8794 two groups can use the same IDs. Refer to |sign-identifier| | |
8795 and |sign-group| for more information. | |
8796 | |
8797 {name} refers to a defined sign. | |
8798 {expr} refers to a buffer name or number. For the accepted | |
8799 values, see |bufname()|. | |
8800 | |
8801 The optional {dict} argument supports the following entries: | |
8802 lnum line number in the file or buffer | |
8803 {expr} where the sign is to be placed. | |
8804 For the accepted values, see |line()|. | |
8805 priority priority of the sign. See | |
8806 |sign-priority| for more information. | |
8807 | |
8808 If the optional {dict} is not specified, then it modifies the | |
8809 placed sign {id} in group {group} to use the defined sign | |
8810 {name}. | |
8811 | |
8812 Returns the sign identifier on success and -1 on failure. | |
8813 | |
8814 Examples: > | |
8815 " Place a sign named sign1 with id 5 at line 20 in | |
8816 " buffer json.c | |
8817 call sign_place(5, '', 'sign1', 'json.c', | |
8818 \ {'lnum' : 20}) | |
8819 | |
8820 " Updates sign 5 in buffer json.c to use sign2 | |
8821 call sign_place(5, '', 'sign2', 'json.c') | |
8822 | |
8823 " Place a sign named sign3 at line 30 in | |
8824 " buffer json.c with a new identifier | |
8825 let id = sign_place(0, '', 'sign3', 'json.c', | |
8826 \ {'lnum' : 30}) | |
8827 | |
8828 " Place a sign named sign4 with id 10 in group 'g3' | |
8829 " at line 40 in buffer json.c with priority 90 | |
8830 call sign_place(10, 'g3', 'sign4', 'json.c', | |
8831 \ {'lnum' : 40, 'priority' : 90}) | |
8832 < | |
8833 *sign_placelist()* | |
8834 sign_placelist({list}) | |
8835 Place one or more signs. This is similar to the | |
8836 |sign_place()| function. The {list} argument specifies the | |
8837 List of signs to place. Each list item is a dict with the | |
8838 following sign attributes: | |
8839 buffer buffer name or number. For the accepted | |
8840 values, see |bufname()|. | |
8841 group sign group. {group} functions as a namespace | |
8842 for {id}, thus two groups can use the same | |
8843 IDs. If not specified or set to an empty | |
8844 string, then the global group is used. See | |
8845 |sign-group| for more information. | |
8846 id sign identifier. If not specified or zero, | |
8847 then a new unique identifier is allocated. | |
8848 Otherwise the specified number is used. See | |
8849 |sign-identifier| for more information. | |
8850 lnum line number in the buffer {expr} where the | |
8851 sign is to be placed. For the accepted values, | |
8852 see |line()|. | |
8853 name name of the sign to place. See |sign_define()| | |
8854 for more information. | |
8855 priority priority of the sign. When multiple signs are | |
8856 placed on a line, the sign with the highest | |
8857 priority is used. If not specified, the | |
8858 default value of 10 is used. See | |
8859 |sign-priority| for more information. | |
8860 | |
8861 If {id} refers to an existing sign, then the existing sign is | |
8862 modified to use the specified {name} and/or {priority}. | |
8863 | |
8864 Returns a List of sign identifiers. If failed to place a | |
8865 sign, the corresponding list item is set to -1. | |
8866 | |
8867 Examples: > | |
8868 " Place sign s1 with id 5 at line 20 and id 10 at line | |
8869 " 30 in buffer a.c | |
8870 let [n1, n2] = sign_placelist([ | |
8871 \ {'id' : 5, | |
8872 \ 'name' : 's1', | |
8873 \ 'buffer' : 'a.c', | |
8874 \ 'lnum' : 20}, | |
8875 \ {'id' : 10, | |
8876 \ 'name' : 's1', | |
8877 \ 'buffer' : 'a.c', | |
8878 \ 'lnum' : 30} | |
8879 \ ]) | |
8880 | |
8881 " Place sign s1 in buffer a.c at line 40 and 50 | |
8882 " with auto-generated identifiers | |
8883 let [n1, n2] = sign_placelist([ | |
8884 \ {'name' : 's1', | |
8885 \ 'buffer' : 'a.c', | |
8886 \ 'lnum' : 40}, | |
8887 \ {'name' : 's1', | |
8888 \ 'buffer' : 'a.c', | |
8889 \ 'lnum' : 50} | |
8890 \ ]) | |
8891 < | |
8892 sign_undefine([{name}]) *sign_undefine()* | |
8893 sign_undefine({list}) | |
8894 Deletes a previously defined sign {name}. This is similar to | |
8895 the |:sign-undefine| command. If {name} is not supplied, then | |
8896 deletes all the defined signs. | |
8897 | |
8898 The one argument {list} can be used to undefine a list of | |
8899 signs. Each list item is the name of a sign. | |
8900 | |
8901 Returns 0 on success and -1 on failure. For the one argument | |
8902 {list} call, returns a list of values one for each undefined | |
8903 sign. | |
8904 | |
8905 Examples: > | |
8906 " Delete a sign named mySign | |
8907 call sign_undefine("mySign") | |
8908 | |
8909 " Delete signs 'sign1' and 'sign2' | |
8910 call sign_undefine(["sign1", "sign2"]) | |
8911 | |
8912 " Delete all the signs | |
8913 call sign_undefine() | |
8914 < | |
8915 sign_unplace({group} [, {dict}]) *sign_unplace()* | |
8916 Remove a previously placed sign in one or more buffers. This | |
8917 is similar to the |:sign-unplace| command. | |
8918 | |
8919 {group} is the sign group name. To use the global sign group, | |
8920 use an empty string. If {group} is set to '*', then all the | |
8921 groups including the global group are used. | |
8922 The signs in {group} are selected based on the entries in | |
8923 {dict}. The following optional entries in {dict} are | |
8924 supported: | |
8925 buffer buffer name or number. See |bufname()|. | |
8926 id sign identifier | |
8927 If {dict} is not supplied, then all the signs in {group} are | |
8928 removed. | |
8929 | |
8930 Returns 0 on success and -1 on failure. | |
8931 | |
8932 Examples: > | |
8933 " Remove sign 10 from buffer a.vim | |
8934 call sign_unplace('', {'buffer' : "a.vim", 'id' : 10}) | |
8935 | |
8936 " Remove sign 20 in group 'g1' from buffer 3 | |
8937 call sign_unplace('g1', {'buffer' : 3, 'id' : 20}) | |
8938 | |
8939 " Remove all the signs in group 'g2' from buffer 10 | |
8940 call sign_unplace('g2', {'buffer' : 10}) | |
8941 | |
8942 " Remove sign 30 in group 'g3' from all the buffers | |
8943 call sign_unplace('g3', {'id' : 30}) | |
8944 | |
8945 " Remove all the signs placed in buffer 5 | |
8946 call sign_unplace('*', {'buffer' : 5}) | |
8947 | |
8948 " Remove the signs in group 'g4' from all the buffers | |
8949 call sign_unplace('g4') | |
8950 | |
8951 " Remove sign 40 from all the buffers | |
8952 call sign_unplace('*', {'id' : 40}) | |
8953 | |
8954 " Remove all the placed signs from all the buffers | |
8955 call sign_unplace('*') | |
8956 < | |
8957 sign_unplacelist({list}) *sign_unplacelist()* | |
8958 Remove previously placed signs from one or more buffers. This | |
8959 is similar to the |sign_unplace()| function. | |
8960 | |
8961 The {list} argument specifies the List of signs to remove. | |
8962 Each list item is a dict with the following sign attributes: | |
8963 buffer buffer name or number. For the accepted | |
8964 values, see |bufname()|. If not specified, | |
8965 then the specified sign is removed from all | |
8966 the buffers. | |
8967 group sign group name. If not specified or set to an | |
8968 empty string, then the global sign group is | |
8969 used. If set to '*', then all the groups | |
8970 including the global group are used. | |
8971 id sign identifier. If not specified, then all | |
8972 the signs in the specified group are removed. | |
8973 | |
8974 Returns a List where an entry is set to 0 if the corresponding | |
8975 sign was successfully removed or -1 on failure. | |
8976 | |
8977 Example: > | |
8978 " Remove sign with id 10 from buffer a.vim and sign | |
8979 " with id 20 from buffer b.vim | |
8980 call sign_unplacelist([ | |
8981 \ {'id' : 10, 'buffer' : "a.vim"}, | |
8982 \ {'id' : 20, 'buffer' : 'b.vim'}, | |
8983 \ ]) | |
8984 < | |
8985 simplify({filename}) *simplify()* | 7988 simplify({filename}) *simplify()* |
8986 Simplify the file name as much as possible without changing | 7989 Simplify the file name as much as possible without changing |
8987 the meaning. Shortcuts (on MS-Windows) or symbolic links (on | 7990 the meaning. Shortcuts (on MS-Windows) or symbolic links (on |
8988 Unix) are not resolved. If the first path component in | 7991 Unix) are not resolved. If the first path component in |
8989 {filename} designates the current directory, this will be | 7992 {filename} designates the current directory, this will be |
9820 :exe "redir > " . tmpfile | 8823 :exe "redir > " . tmpfile |
9821 < For Unix, the file will be in a private directory |tempfile|. | 8824 < For Unix, the file will be in a private directory |tempfile|. |
9822 For MS-Windows forward slashes are used when the 'shellslash' | 8825 For MS-Windows forward slashes are used when the 'shellslash' |
9823 option is set or when 'shellcmdflag' starts with '-'. | 8826 option is set or when 'shellcmdflag' starts with '-'. |
9824 | 8827 |
8828 | |
9825 term_ functions are documented here: |terminal-function-details| | 8829 term_ functions are documented here: |terminal-function-details| |
9826 | 8830 |
9827 test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()* | 8831 test_ functions are documented here: |test-functions| |
9828 This is for testing: If the memory allocation with {id} is | 8832 |
9829 called, then decrement {countdown}, and when it reaches zero | |
9830 let memory allocation fail {repeat} times. When {repeat} is | |
9831 smaller than one it fails one time. | |
9832 | |
9833 test_autochdir() *test_autochdir()* | |
9834 Set a flag to enable the effect of 'autochdir' before Vim | |
9835 startup has finished. | |
9836 | |
9837 test_feedinput({string}) *test_feedinput()* | |
9838 Characters in {string} are queued for processing as if they | |
9839 were typed by the user. This uses a low level input buffer. | |
9840 This function works only when with |+unix| or GUI is running. | |
9841 | |
9842 test_garbagecollect_now() *test_garbagecollect_now()* | |
9843 Like garbagecollect(), but executed right away. This must | |
9844 only be called directly to avoid any structure to exist | |
9845 internally, and |v:testing| must have been set before calling | |
9846 any function. | |
9847 | |
9848 test_garbagecollect_soon() *test_garbagecollect_soon()* | |
9849 Set the flag to call the garbagecollector as if in the main | |
9850 loop. Only to be used in tests. | |
9851 | |
9852 test_getvalue({name}) *test_getvalue()* | |
9853 Get the value of an internal variable. These values for | |
9854 {name} are supported: | |
9855 need_fileinfo | |
9856 | |
9857 test_ignore_error({expr}) *test_ignore_error()* | |
9858 Ignore any error containing {expr}. A normal message is given | |
9859 instead. | |
9860 This is only meant to be used in tests, where catching the | |
9861 error with try/catch cannot be used (because it skips over | |
9862 following code). | |
9863 {expr} is used literally, not as a pattern. | |
9864 When the {expr} is the string "RESET" then the list of ignored | |
9865 errors is made empty. | |
9866 | |
9867 test_null_blob() *test_null_blob()* | |
9868 Return a |Blob| that is null. Only useful for testing. | |
9869 | |
9870 test_null_channel() *test_null_channel()* | |
9871 Return a |Channel| that is null. Only useful for testing. | |
9872 {only available when compiled with the +channel feature} | |
9873 | |
9874 test_null_dict() *test_null_dict()* | |
9875 Return a |Dict| that is null. Only useful for testing. | |
9876 | |
9877 test_null_job() *test_null_job()* | |
9878 Return a |Job| that is null. Only useful for testing. | |
9879 {only available when compiled with the +job feature} | |
9880 | |
9881 test_null_list() *test_null_list()* | |
9882 Return a |List| that is null. Only useful for testing. | |
9883 | |
9884 test_null_partial() *test_null_partial()* | |
9885 Return a |Partial| that is null. Only useful for testing. | |
9886 | |
9887 test_null_string() *test_null_string()* | |
9888 Return a |String| that is null. Only useful for testing. | |
9889 | |
9890 test_option_not_set({name}) *test_option_not_set()* | |
9891 Reset the flag that indicates option {name} was set. Thus it | |
9892 looks like it still has the default value. Use like this: > | |
9893 set ambiwidth=double | |
9894 call test_option_not_set('ambiwidth') | |
9895 < Now the 'ambiwidth' option behaves like it was never changed, | |
9896 even though the value is "double". | |
9897 Only to be used for testing! | |
9898 | |
9899 test_override({name}, {val}) *test_override()* | |
9900 Overrides certain parts of Vim's internal processing to be able | |
9901 to run tests. Only to be used for testing Vim! | |
9902 The override is enabled when {val} is non-zero and removed | |
9903 when {val} is zero. | |
9904 Current supported values for name are: | |
9905 | |
9906 name effect when {val} is non-zero ~ | |
9907 redraw disable the redrawing() function | |
9908 redraw_flag ignore the RedrawingDisabled flag | |
9909 char_avail disable the char_avail() function | |
9910 starting reset the "starting" variable, see below | |
9911 nfa_fail makes the NFA regexp engine fail to force a | |
9912 fallback to the old engine | |
9913 no_query_mouse do not query the mouse position for "dec" | |
9914 terminals | |
9915 no_wait_return set the "no_wait_return" flag. Not restored | |
9916 with "ALL". | |
9917 ALL clear all overrides ({val} is not used) | |
9918 | |
9919 "starting" is to be used when a test should behave like | |
9920 startup was done. Since the tests are run by sourcing a | |
9921 script the "starting" variable is non-zero. This is usually a | |
9922 good thing (tests run faster), but sometimes changes behavior | |
9923 in a way that the test doesn't work properly. | |
9924 When using: > | |
9925 call test_override('starting', 1) | |
9926 < The value of "starting" is saved. It is restored by: > | |
9927 call test_override('starting', 0) | |
9928 | |
9929 test_refcount({expr}) *test_refcount()* | |
9930 Return the reference count of {expr}. When {expr} is of a | |
9931 type that does not have a reference count, returns -1. Only | |
9932 to be used for testing. | |
9933 | |
9934 test_scrollbar({which}, {value}, {dragging}) *test_scrollbar()* | |
9935 Pretend using scrollbar {which} to move it to position | |
9936 {value}. {which} can be: | |
9937 left Left scrollbar of the current window | |
9938 right Right scrollbar of the current window | |
9939 hor Horizontal scrollbar | |
9940 | |
9941 For the vertical scrollbars {value} can be 1 to the | |
9942 line-count of the buffer. For the horizontal scrollbar the | |
9943 {value} can be between 1 and the maximum line length, assuming | |
9944 'wrap' is not set. | |
9945 | |
9946 When {dragging} is non-zero it's like dragging the scrollbar, | |
9947 otherwise it's like clicking in the scrollbar. | |
9948 Only works when the {which} scrollbar actually exists, | |
9949 obviously only when using the GUI. | |
9950 | |
9951 test_setmouse({row}, {col}) *test_setmouse()* | |
9952 Set the mouse position to be used for the next mouse action. | |
9953 {row} and {col} are one based. | |
9954 For example: > | |
9955 call test_setmouse(4, 20) | |
9956 call feedkeys("\<LeftMouse>", "xt") | |
9957 | |
9958 test_settime({expr}) *test_settime()* | |
9959 Set the time Vim uses internally. Currently only used for | |
9960 timestamps in the history, as they are used in viminfo, and | |
9961 for undo. | |
9962 Using a value of 1 makes Vim not sleep after a warning or | |
9963 error message. | |
9964 {expr} must evaluate to a number. When the value is zero the | |
9965 normal behavior is restored. | |
9966 | 8833 |
9967 *timer_info()* | 8834 *timer_info()* |
9968 timer_info([{id}]) | 8835 timer_info([{id}]) |
9969 Return a list with information about timers. | 8836 Return a list with information about timers. |
9970 When {id} is given only information about this timer is | 8837 When {id} is given only information about this timer is |
13119 - jumping to another buffer or window | 11986 - jumping to another buffer or window |
13120 - editing another file | 11987 - editing another file |
13121 - closing a window or quitting Vim | 11988 - closing a window or quitting Vim |
13122 - etc. | 11989 - etc. |
13123 | 11990 |
13124 ============================================================================== | |
13125 14. Testing *testing* | |
13126 | |
13127 Vim can be tested after building it, usually with "make test". | |
13128 The tests are located in the directory "src/testdir". | |
13129 | |
13130 There are several types of tests added over time: | |
13131 test33.in oldest, don't add any more | |
13132 test_something.in old style tests | |
13133 test_something.vim new style tests | |
13134 | |
13135 *new-style-testing* | |
13136 New tests should be added as new style tests. These use functions such as | |
13137 |assert_equal()| to keep the test commands and the expected result in one | |
13138 place. | |
13139 *old-style-testing* | |
13140 In some cases an old style test needs to be used. E.g. when testing Vim | |
13141 without the |+eval| feature. | |
13142 | |
13143 Find more information in the file src/testdir/README.txt. | |
13144 | |
13145 | 11991 |
13146 vim:tw=78:ts=8:noet:ft=help:norl: | 11992 vim:tw=78:ts=8:noet:ft=help:norl: |