Mercurial > vim
comparison src/testdir/test_execute_func.vim @ 26666:bbcbb3c13fba v8.2.3862
patch 8.2.3862: crash on exit with EXITFREE and using win_execute()
Commit: https://github.com/vim/vim/commit/dab17a0689a2f31f69f428975f84b0c3c7ba3030
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Dec 20 21:35:59 2021 +0000
patch 8.2.3862: crash on exit with EXITFREE and using win_execute()
Problem: Crash on exit with EXITFREE and using win_execute().
Solution: Also save and restore tp_topframe. (issue https://github.com/vim/vim/issues/9374)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 20 Dec 2021 22:45:03 +0100 |
parents | a07323eb647f |
children | aa613a3084b9 |
comparison
equal
deleted
inserted
replaced
26665:5623a07d7104 | 26666:bbcbb3c13fba |
---|---|
1 " test execute() | 1 " test execute() |
2 | 2 |
3 source view_util.vim | 3 source view_util.vim |
4 source check.vim | 4 source check.vim |
5 source vim9.vim | 5 source vim9.vim |
6 source term_util.vim | |
6 | 7 |
7 func NestedEval() | 8 func NestedEval() |
8 let nested = execute('echo "nested\nlines"') | 9 let nested = execute('echo "nested\nlines"') |
9 echo 'got: "' . nested . '"' | 10 echo 'got: "' . nested . '"' |
10 endfunc | 11 endfunc |
146 call assert_equal(1, xyz) | 147 call assert_equal(1, xyz) |
147 tabclose | 148 tabclose |
148 unlet xyz | 149 unlet xyz |
149 endfunc | 150 endfunc |
150 | 151 |
152 func Test_win_execute_on_startup() | |
153 CheckRunVimInTerminal | |
154 | |
155 let lines =<< trim END | |
156 vim9script | |
157 [repeat('x', &columns)]->writefile('Xfile1') | |
158 silent tabedit Xfile2 | |
159 var id = win_getid() | |
160 silent tabedit Xfile3 | |
161 autocmd VimEnter * win_execute(id, 'close') | |
162 END | |
163 call writefile(lines, 'XwinExecute') | |
164 let buf = RunVimInTerminal('-p Xfile1 -Nu XwinExecute', {}) | |
165 | |
166 " this was crashing on exit with EXITFREE defined | |
167 call StopVimInTerminal(buf) | |
168 | |
169 call delete('XwinExecute') | |
170 call delete('Xfile1') | |
171 endfunc | |
172 | |
151 func Test_execute_func_with_null() | 173 func Test_execute_func_with_null() |
152 call assert_equal("", execute(test_null_string())) | 174 call assert_equal("", execute(test_null_string())) |
153 call assert_equal("", execute(test_null_list())) | 175 call assert_equal("", execute(test_null_list())) |
154 call assert_fails('call execute(test_null_dict())', 'E731:') | 176 call assert_fails('call execute(test_null_dict())', 'E731:') |
155 call assert_fails('call execute(test_null_blob())', 'E976:') | 177 call assert_fails('call execute(test_null_blob())', 'E976:') |