mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.2.3965: Vim9: no easy way to check if Vim9 script is supported
Problem: Vim9: no easy way to check if Vim9 script is supported. Solution: Add has('vim9script').
This commit is contained in:
@@ -5929,6 +5929,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
0
|
||||
#endif
|
||||
},
|
||||
{"vim9script", 1},
|
||||
{"vimscript-1", 1},
|
||||
{"vimscript-2", 1},
|
||||
{"vimscript-3", 1},
|
||||
|
@@ -7,6 +7,23 @@ source vim9.vim
|
||||
source shared.vim
|
||||
source screendump.vim
|
||||
|
||||
def Test_vim9script_feature()
|
||||
# example from the help, here the feature is always present
|
||||
var lines =<< trim END
|
||||
" old style comment
|
||||
if !has('vim9script')
|
||||
" legacy commands would go here
|
||||
finish
|
||||
endif
|
||||
vim9script
|
||||
# Vim9 script commands go here
|
||||
g:didit = true
|
||||
END
|
||||
CheckScriptSuccess(lines)
|
||||
assert_equal(true, g:didit)
|
||||
unlet g:didit
|
||||
enddef
|
||||
|
||||
def Test_range_only()
|
||||
new
|
||||
setline(1, ['blah', 'Blah'])
|
||||
|
@@ -749,6 +749,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
3965,
|
||||
/**/
|
||||
3964,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user