comparison runtime/doc/eval.txt @ 19742:810eee1b42e3 v8.2.0427

patch 8.2.0427: it is not possible to check for a typo in a feature name Commit: https://github.com/vim/vim/commit/7929651e05b081fe55e0e745725a7ad78c51be16 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 22 16:17:14 2020 +0100 patch 8.2.0427: it is not possible to check for a typo in a feature name Problem: It is not possible to check for a typo in a feature name. Solution: Add an extra argument to has().
author Bram Moolenaar <Bram@vim.org>
date Sun, 22 Mar 2020 16:30:03 +0100
parents bceeded72898
children 546bdeef35f1
comparison
equal deleted inserted replaced
19741:350dcc40421f 19742:810eee1b42e3
1 *eval.txt* For Vim version 8.2. Last change: 2020 Mar 16 1 *eval.txt* For Vim version 8.2. Last change: 2020 Mar 22
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
2513 glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) 2513 glob({expr} [, {nosuf} [, {list} [, {alllinks}]]])
2514 any expand file wildcards in {expr} 2514 any expand file wildcards in {expr}
2515 glob2regpat({expr}) String convert a glob pat into a search pat 2515 glob2regpat({expr}) String convert a glob pat into a search pat
2516 globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) 2516 globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
2517 String do glob({expr}) for all dirs in {path} 2517 String do glob({expr}) for all dirs in {path}
2518 has({feature}) Number |TRUE| if feature {feature} supported 2518 has({feature} [, {check}]) Number |TRUE| if feature {feature} supported
2519 has_key({dict}, {key}) Number |TRUE| if {dict} has entry {key} 2519 has_key({dict}, {key}) Number |TRUE| if {dict} has entry {key}
2520 haslocaldir([{winnr} [, {tabnr}]]) 2520 haslocaldir([{winnr} [, {tabnr}]])
2521 Number |TRUE| if the window executed |:lcd| 2521 Number |TRUE| if the window executed |:lcd|
2522 or |:tcd| 2522 or |:tcd|
2523 hasmapto({what} [, {mode} [, {abbr}]]) 2523 hasmapto({what} [, {mode} [, {abbr}]])
4356 if coming from a mapping. This matters for undo, 4356 if coming from a mapping. This matters for undo,
4357 opening folds, etc. 4357 opening folds, etc.
4358 'L' Lowlevel input. Only works for Unix or when using the 4358 'L' Lowlevel input. Only works for Unix or when using the
4359 GUI. Keys are used as if they were coming from the 4359 GUI. Keys are used as if they were coming from the
4360 terminal. Other flags are not used. *E980* 4360 terminal. Other flags are not used. *E980*
4361 When a CTRL-C interrupts it sets the internal 4361 When a CTRL-C interrupts and 't' is included it sets
4362 "got_int" flag. 4362 the internal "got_int" flag.
4363 'i' Insert the string instead of appending (see above). 4363 'i' Insert the string instead of appending (see above).
4364 'x' Execute commands until typeahead is empty. This is 4364 'x' Execute commands until typeahead is empty. This is
4365 similar to using ":normal!". You can call feedkeys() 4365 similar to using ":normal!". You can call feedkeys()
4366 several times without 'x' and then one time with 'x' 4366 several times without 'x' and then one time with 'x'
4367 (possibly with an empty {string}) to execute all the 4367 (possibly with an empty {string}) to execute all the
5826 Can also be used as a |method|, the base is passed as the 5826 Can also be used as a |method|, the base is passed as the
5827 second argument: > 5827 second argument: >
5828 GetExpr()->globpath(&rtp) 5828 GetExpr()->globpath(&rtp)
5829 < 5829 <
5830 *has()* 5830 *has()*
5831 has({feature}) The result is a Number, which is 1 if the feature {feature} is 5831 has({feature} [, {check}])
5832 supported, zero otherwise. The {feature} argument is a 5832 When {check} is omitted or is zero: The result is a Number,
5833 string. See |feature-list| below. 5833 which is 1 if the feature {feature} is supported, zero
5834 otherwise. The {feature} argument is a string, case is
5835 ignored. See |feature-list| below.
5836
5837 When {check} is present and not zero: The result is a Number,
5838 which is 1 if the feature {feature} could ever be supported,
5839 zero otherwise. This is useful to check for a typo in
5840 {feature}. Keep in mind that an older Vim version will not
5841 know about a feature added later.
5842
5834 Also see |exists()|. 5843 Also see |exists()|.
5844
5835 Note that to skip code that has a syntax error when the 5845 Note that to skip code that has a syntax error when the
5836 feature is not available, Vim may skip the rest of the line 5846 feature is not available, Vim may skip the rest of the line
5837 and miss a following `endif`. Therfore put the `endif` on a 5847 and miss a following `endif`. Therfore put the `endif` on a
5838 separate line: > 5848 separate line: >
5839 if has('feature') 5849 if has('feature')