aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/buffer_spec.lua
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2015-04-06 17:47:08 -0400
committerScott Prager <splinterofchaos@gmail.com>2015-04-07 16:05:00 -0400
commit8cac2eea751379e0195b5160f9d14d19f8866e71 (patch)
tree1b59157c5f89cc8db04422d6df715cf59defde27 /test/functional/terminal/buffer_spec.lua
parent013bd4461d95341fbd7c2f742844666a5e966f94 (diff)
downloadrneovim-8cac2eea751379e0195b5160f9d14d19f8866e71.tar.gz
rneovim-8cac2eea751379e0195b5160f9d14d19f8866e71.tar.bz2
rneovim-8cac2eea751379e0195b5160f9d14d19f8866e71.zip
term: ensure term->buf is valid
The fallowing test (reduced), submitted by @mhinz may free term->buf, leaving the pointer dangling. ```vim let s:buf = -1 function! s:exit_handler() execute 'bdelete!' s:buf endfunction vnew let s:buf = bufnr('%') let id = termopen('sleep 1', { 'on_exit': function('s:exit_handler') }) call s:test() ``` When the buffer is known to be closing, set term->buf to NULL, and check buf_valid() in on_refresh(). Helped-by: Marco Hinz (@mhinz)
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
0 files changed, 0 insertions, 0 deletions