Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 23886:eef0cffbdb94 v8.2.2485
patch 8.2.2485: when sourcing a script again the script version isn't reset
Commit: https://github.com/vim/vim/commit/0123cc1e1422003704cc6941916dd75e61fb7976
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 7 17:17:58 2021 +0100
patch 8.2.2485: when sourcing a script again the script version isn't reset
Problem: When sourcing a script again the script version isn't reset.
Solution: Set sn_version to one when sourcing a script again. Clear
sn_save_cpo properly. (closes #7608)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 07 Feb 2021 17:30:04 +0100 |
parents | 00e904bdb8a5 |
children | a834f9c082e3 |
comparison
equal
deleted
inserted
replaced
23885:8ea16fd1a3ba | 23886:eef0cffbdb94 |
---|---|
2205 result ..= cnt .. '_' | 2205 result ..= cnt .. '_' |
2206 endwhile | 2206 endwhile |
2207 assert_equal('1_3_', result) | 2207 assert_equal('1_3_', result) |
2208 | 2208 |
2209 var s = '' | 2209 var s = '' |
2210 while s == 'x' #{comment | 2210 while s == 'x' #{comment} |
2211 endwhile | 2211 endwhile |
2212 enddef | 2212 enddef |
2213 | 2213 |
2214 def Test_while_loop_fails() | 2214 def Test_while_loop_fails() |
2215 CheckDefFailure(['while xxx'], 'E1001:') | 2215 CheckDefFailure(['while xxx'], 'E1001:') |
3153 assert_equal(['done'], readfile('Xdone')) | 3153 assert_equal(['done'], readfile('Xdone')) |
3154 endif | 3154 endif |
3155 delete('Xsourced') | 3155 delete('Xsourced') |
3156 delete('Xclose') | 3156 delete('Xclose') |
3157 delete('Xdone') | 3157 delete('Xdone') |
3158 | |
3159 writefile(['vim9script'], 'XanotherScript') | |
3160 set cpo=aABceFsMny> | |
3161 edit XanotherScript | |
3162 so % | |
3163 assert_equal('aABceFsMny>', &cpo) | |
3164 :1del | |
3165 w | |
3166 so % | |
3167 assert_equal('aABceFsMny>', &cpo) | |
3168 | |
3169 delete('XanotherScript') | |
3170 set cpo&vim | |
3158 enddef | 3171 enddef |
3159 | 3172 |
3160 | 3173 |
3161 def Test_unset_any_variable() | 3174 def Test_unset_any_variable() |
3162 var lines =<< trim END | 3175 var lines =<< trim END |