comparison src/testdir/check.vim @ 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 a4b65930a0dc
children 1da2fb80b512
comparison
equal deleted inserted replaced
19741:350dcc40421f 19742:810eee1b42e3
4 command -nargs=1 MissingFeature throw 'Skipped: ' .. <args> .. ' feature missing' 4 command -nargs=1 MissingFeature throw 'Skipped: ' .. <args> .. ' feature missing'
5 5
6 " Command to check for the presence of a feature. 6 " Command to check for the presence of a feature.
7 command -nargs=1 CheckFeature call CheckFeature(<f-args>) 7 command -nargs=1 CheckFeature call CheckFeature(<f-args>)
8 func CheckFeature(name) 8 func CheckFeature(name)
9 if !has(a:name, 1)
10 throw 'Checking for non-existent feature ' .. a:name
11 endif
9 if !has(a:name) 12 if !has(a:name)
10 MissingFeature a:name 13 MissingFeature a:name
11 endif 14 endif
12 endfunc 15 endfunc
13 16