diff options
-rw-r--r-- | src/scriptfile.c | 3 | ||||
-rw-r--r-- | src/testdir/test_vim9_script.vim | 11 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/scriptfile.c b/src/scriptfile.c index 7e5ea4c63d..bf4cbc0ea6 100644 --- a/src/scriptfile.c +++ b/src/scriptfile.c @@ -1491,8 +1491,7 @@ almosttheend: si = SCRIPT_ITEM(current_sctx.sc_sid); if (si->sn_save_cpo != NULL) { - free_string_option(p_cpo); - p_cpo = si->sn_save_cpo; + set_option_value((char_u *)"cpo", 0L, si->sn_save_cpo, 0); si->sn_save_cpo = NULL; } diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 7012f9e529..72a373a31c 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -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 diff --git a/src/version.c b/src/version.c index 9bb587dff6..8eec20e660 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2122, +/**/ 2121, /**/ 2120, |