Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 25174:b32c83317492 v8.2.3123
patch 8.2.3123: Vim9: confusing error when using white space after option
Commit: https://github.com/vim/vim/commit/1594f313452cf6ca88375d9c8f68605a9c3c8ab5
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 8 16:40:13 2021 +0200
patch 8.2.3123: Vim9: confusing error when using white space after option
Problem: Vim9: confusing error when using white space after option, before
one of "!&<".
Solution: Give a specific error. (issue #8408)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 08 Jul 2021 16:45:04 +0200 |
parents | 0e08e34fa0b8 |
children | af3d0198faad |
comparison
equal
deleted
inserted
replaced
25173:74d0efab9bb4 | 25174:b32c83317492 |
---|---|
4074 nunmap <F3> | 4074 nunmap <F3> |
4075 delfunc g:FuncA | 4075 delfunc g:FuncA |
4076 enddef | 4076 enddef |
4077 | 4077 |
4078 def Test_option_modifier() | 4078 def Test_option_modifier() |
4079 # legacy script allows for white space | |
4079 var lines =<< trim END | 4080 var lines =<< trim END |
4080 set hlsearch & hlsearch ! | 4081 set hlsearch & hlsearch ! |
4081 call assert_equal(1, &hlsearch) | 4082 call assert_equal(1, &hlsearch) |
4082 END | 4083 END |
4083 CheckScriptSuccess(lines) | 4084 CheckScriptSuccess(lines) |
4084 | 4085 |
4086 set hlsearch | |
4087 set hlsearch! | |
4088 assert_equal(false, &hlsearch) | |
4089 | |
4090 set hlsearch | |
4091 set hlsearch& | |
4092 assert_equal(false, &hlsearch) | |
4093 | |
4085 lines =<< trim END | 4094 lines =<< trim END |
4086 vim9script | |
4087 set hlsearch & | 4095 set hlsearch & |
4088 END | 4096 END |
4089 CheckScriptFailure(lines, 'E518:') | 4097 CheckDefExecAndScriptFailure(lines, 'E1205: No white space allowed between option and: &') |
4090 | 4098 |
4091 lines =<< trim END | 4099 lines =<< trim END |
4092 vim9script | 4100 set hlsearch ! |
4093 set hlsearch & hlsearch ! | 4101 END |
4094 END | 4102 CheckDefExecAndScriptFailure(lines, 'E1205: No white space allowed between option and: !') |
4095 CheckScriptFailure(lines, 'E518:') | 4103 |
4104 set hlsearch& | |
4096 enddef | 4105 enddef |
4097 | 4106 |
4098 " Keep this last, it messes up highlighting. | 4107 " Keep this last, it messes up highlighting. |
4099 def Test_substitute_cmd() | 4108 def Test_substitute_cmd() |
4100 new | 4109 new |