Mercurial > vim
comparison src/testdir/test_terminal.vim @ 13720:7d2039b2ecc8 v8.0.1732
patch 8.0.1732: crash when terminal API call deletes the buffer
commit https://github.com/vim/vim/commit/a997b45c7e350ea5b378ca0c52ed3d4cc610975c
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Apr 17 23:24:06 2018 +0200
patch 8.0.1732: crash when terminal API call deletes the buffer
Problem: Crash when terminal API call deletes the buffer.
Solution: Lock the buffer while calling a function. (closes https://github.com/vim/vim/issues/2813)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 17 Apr 2018 23:30:07 +0200 |
parents | b28d679b1843 |
children | a34b1323286c |
comparison
equal
deleted
inserted
replaced
13719:fb1a9741c1c5 | 13720:7d2039b2ecc8 |
---|---|
1285 call delete('Xscript') | 1285 call delete('Xscript') |
1286 call ch_logfile('', '') | 1286 call ch_logfile('', '') |
1287 call delete('Xlog') | 1287 call delete('Xlog') |
1288 endfunc | 1288 endfunc |
1289 | 1289 |
1290 let s:caught_e937 = 0 | |
1291 | |
1292 func Tapi_Delete(bufnum, arg) | |
1293 try | |
1294 execute 'bdelete!' a:bufnum | |
1295 catch /E937:/ | |
1296 let s:caught_e937 = 1 | |
1297 endtry | |
1298 endfunc | |
1299 | |
1300 func Test_terminal_api_call_fail_delete() | |
1301 if !CanRunVimInTerminal() | |
1302 return | |
1303 endif | |
1304 | |
1305 call WriteApiCall('Tapi_Delete') | |
1306 let buf = RunVimInTerminal('-S Xscript', {}) | |
1307 call WaitFor({-> s:caught_e937 == 1}) | |
1308 | |
1309 call StopVimInTerminal(buf) | |
1310 call delete('Xscript') | |
1311 call ch_logfile('', '') | |
1312 endfunc | |
1313 | |
1290 func Test_terminal_ansicolors_default() | 1314 func Test_terminal_ansicolors_default() |
1291 let colors = [ | 1315 let colors = [ |
1292 \ '#000000', '#e00000', | 1316 \ '#000000', '#e00000', |
1293 \ '#00e000', '#e0e000', | 1317 \ '#00e000', '#e0e000', |
1294 \ '#0000e0', '#e000e0', | 1318 \ '#0000e0', '#e000e0', |