Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 26873:be85735650f7 v8.2.3965
patch 8.2.3965: Vim9: no easy way to check if Vim9 script is supported
Commit: https://github.com/vim/vim/commit/b79ee0c299d786627784f7304ba84b80e78ece26
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 1 12:17:00 2022 +0000
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').
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 01 Jan 2022 13:30:03 +0100 |
parents | dcd1c244e332 |
children | 8796f1384750 |
comparison
equal
deleted
inserted
replaced
26872:fdb37f03e58d | 26873:be85735650f7 |
---|---|
4 source term_util.vim | 4 source term_util.vim |
5 source view_util.vim | 5 source view_util.vim |
6 source vim9.vim | 6 source vim9.vim |
7 source shared.vim | 7 source shared.vim |
8 source screendump.vim | 8 source screendump.vim |
9 | |
10 def Test_vim9script_feature() | |
11 # example from the help, here the feature is always present | |
12 var lines =<< trim END | |
13 " old style comment | |
14 if !has('vim9script') | |
15 " legacy commands would go here | |
16 finish | |
17 endif | |
18 vim9script | |
19 # Vim9 script commands go here | |
20 g:didit = true | |
21 END | |
22 CheckScriptSuccess(lines) | |
23 assert_equal(true, g:didit) | |
24 unlet g:didit | |
25 enddef | |
9 | 26 |
10 def Test_range_only() | 27 def Test_range_only() |
11 new | 28 new |
12 setline(1, ['blah', 'Blah']) | 29 setline(1, ['blah', 'Blah']) |
13 :/Blah/ | 30 :/Blah/ |