0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.2122: Vim9: crash when sourcing vim9script early

Problem:    Vim9: crash when sourcing vim9script early.
Solution:   Use set_option_value() instead of setting p_cpo directly.
            (closes #7441)
This commit is contained in:
Bram Moolenaar
2020-12-09 17:16:59 +01:00
parent a7a691cc14
commit 9ec7026f24
3 changed files with 14 additions and 2 deletions

View File

@@ -2857,6 +2857,17 @@ def Test_invalid_sid()
delete('Xdidit')
enddef
def Test_restoring_cpo()
writefile(['vim9script', 'set nocp'], 'Xsourced')
writefile(['call writefile(["done"], "Xdone")', 'quit!'], 'Xclose')
if RunVim([], [], '-u NONE +"set cpo+=a" -S Xsourced -S Xclose')
assert_equal(['done'], readfile('Xdone'))
endif
delete('Xsourced')
delete('Xclose')
enddef
def Test_unset_any_variable()
var lines =<< trim END
var name: any