diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-03-22 16:17:14 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-03-22 16:17:14 +0100 |
commit | 7929651e05b081fe55e0e745725a7ad78c51be16 (patch) | |
tree | 547fffcb659d850bf483beb98ea214259f337adc /runtime | |
parent | 9b9be007e7d674f49fc2b650f840d08532b180ad (diff) | |
download | vim-git-7929651e05b081fe55e0e745725a7ad78c51be16.tar.gz |
patch 8.2.0427: it is not possible to check for a typo in a feature namev8.2.0427
Problem: It is not possible to check for a typo in a feature name.
Solution: Add an extra argument to has().
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 6c7435c9a..00df40478 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.2. Last change: 2020 Mar 16 +*eval.txt* For Vim version 8.2. Last change: 2020 Mar 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2515,7 +2515,7 @@ glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) glob2regpat({expr}) String convert a glob pat into a search pat globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) String do glob({expr}) for all dirs in {path} -has({feature}) Number |TRUE| if feature {feature} supported +has({feature} [, {check}]) Number |TRUE| if feature {feature} supported has_key({dict}, {key}) Number |TRUE| if {dict} has entry {key} haslocaldir([{winnr} [, {tabnr}]]) Number |TRUE| if the window executed |:lcd| @@ -4358,8 +4358,8 @@ feedkeys({string} [, {mode}]) *feedkeys()* 'L' Lowlevel input. Only works for Unix or when using the GUI. Keys are used as if they were coming from the terminal. Other flags are not used. *E980* - When a CTRL-C interrupts it sets the internal - "got_int" flag. + When a CTRL-C interrupts and 't' is included it sets + the internal "got_int" flag. 'i' Insert the string instead of appending (see above). 'x' Execute commands until typeahead is empty. This is similar to using ":normal!". You can call feedkeys() @@ -5828,10 +5828,20 @@ globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) GetExpr()->globpath(&rtp) < *has()* -has({feature}) The result is a Number, which is 1 if the feature {feature} is - supported, zero otherwise. The {feature} argument is a - string. See |feature-list| below. +has({feature} [, {check}]) + When {check} is omitted or is zero: The result is a Number, + which is 1 if the feature {feature} is supported, zero + otherwise. The {feature} argument is a string, case is + ignored. See |feature-list| below. + + When {check} is present and not zero: The result is a Number, + which is 1 if the feature {feature} could ever be supported, + zero otherwise. This is useful to check for a typo in + {feature}. Keep in mind that an older Vim version will not + know about a feature added later. + Also see |exists()|. + Note that to skip code that has a syntax error when the feature is not available, Vim may skip the rest of the line and miss a following `endif`. Therfore put the `endif` on a |