comparison runtime/doc/eval.txt @ 18699:1febd1aa9930 v8.1.2341

patch 8.1.2341: not so easy to interrupt a script programatically Commit: https://github.com/vim/vim/commit/67a2deb9cb4ac2224cb1e4d240a5d0659f036264 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 25 00:05:32 2019 +0100 patch 8.1.2341: not so easy to interrupt a script programatically Problem: Not so easy to interrupt a script programatically. Solution: Add the interrupt() function. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/2834)
author Bram Moolenaar <Bram@vim.org>
date Mon, 25 Nov 2019 00:15:06 +0100
parents 9007e9896303
children 128662297ddf
comparison
equal deleted inserted replaced
18698:13e7c756367c 18699:1febd1aa9930
1 *eval.txt* For Vim version 8.1. Last change: 2019 Nov 21 1 *eval.txt* For Vim version 8.1. Last change: 2019 Nov 24
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
2529 inputlist({textlist}) Number let the user pick from a choice list 2529 inputlist({textlist}) Number let the user pick from a choice list
2530 inputrestore() Number restore typeahead 2530 inputrestore() Number restore typeahead
2531 inputsave() Number save and clear typeahead 2531 inputsave() Number save and clear typeahead
2532 inputsecret({prompt} [, {text}]) String like input() but hiding the text 2532 inputsecret({prompt} [, {text}]) String like input() but hiding the text
2533 insert({object}, {item} [, {idx}]) List insert {item} in {object} [before {idx}] 2533 insert({object}, {item} [, {idx}]) List insert {item} in {object} [before {idx}]
2534 interrupt() none interrupt script execution
2534 invert({expr}) Number bitwise invert 2535 invert({expr}) Number bitwise invert
2535 isdirectory({directory}) Number |TRUE| if {directory} is a directory 2536 isdirectory({directory}) Number |TRUE| if {directory} is a directory
2536 isinf({expr}) Number determine if {expr} is infinity value 2537 isinf({expr}) Number determine if {expr} is infinity value
2537 (positive or negative) 2538 (positive or negative)
2538 islocked({expr}) Number |TRUE| if {expr} is locked 2539 islocked({expr}) Number |TRUE| if {expr} is locked
6179 item. Use |extend()| to concatenate |Lists|. 6180 item. Use |extend()| to concatenate |Lists|.
6180 6181
6181 Can also be used as a |method|: > 6182 Can also be used as a |method|: >
6182 mylist->insert(item) 6183 mylist->insert(item)
6183 6184
6185 interrupt() *interrupt()*
6186 Interrupt script execution. It works more or less like the
6187 user typing CTRL-C, most commands won't execute and control
6188 returns to the user. This is useful to abort execution
6189 from lower down, e.g. in an autocommand. Example: >
6190 :function s:check_typoname(file)
6191 : if fnamemodify(a:file, ':t') == '['
6192 : echomsg 'Maybe typo'
6193 : call interrupt()
6194 : endif
6195 :endfunction
6196 :au BufWritePre * call s:check_typoname(expand('<amatch>'))
6197
6184 invert({expr}) *invert()* 6198 invert({expr}) *invert()*
6185 Bitwise invert. The argument is converted to a number. A 6199 Bitwise invert. The argument is converted to a number. A
6186 List, Dict or Float argument causes an error. Example: > 6200 List, Dict or Float argument causes an error. Example: >
6187 :let bits = invert(bits) 6201 :let bits = invert(bits)
6188 < Can also be used as a |method|: > 6202 < Can also be used as a |method|: >