Mercurial > vim
diff 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 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -2207,7 +2207,7 @@ def Test_while_loop() assert_equal('1_3_', result) var s = '' - while s == 'x' #{comment + while s == 'x' #{comment} endwhile enddef @@ -3155,6 +3155,19 @@ def Test_restoring_cpo() delete('Xsourced') delete('Xclose') delete('Xdone') + + writefile(['vim9script'], 'XanotherScript') + set cpo=aABceFsMny> + edit XanotherScript + so % + assert_equal('aABceFsMny>', &cpo) + :1del + w + so % + assert_equal('aABceFsMny>', &cpo) + + delete('XanotherScript') + set cpo&vim enddef