comparison src/testdir/test_mksession.vim @ 22226:4ed106deb772 v8.2.1662

patch 8.2.1662: :mksession does not restore shared terminal buffer properly Commit: https://github.com/vim/vim/commit/0e655111e9dbdbdf69fee1b199f2b9c355bf4a10 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 11 20:36:36 2020 +0200 patch 8.2.1662: :mksession does not restore shared terminal buffer properly Problem: :mksession does not restore shared terminal buffer properly. Solution: Keep a hashtab with terminal buffers. (Rob Pilling, closes https://github.com/vim/vim/issues/6930)
author Bram Moolenaar <Bram@vim.org>
date Fri, 11 Sep 2020 20:45:04 +0200
parents 08940efa6b4e
children 0bbc8be90207
comparison
equal deleted inserted replaced
22225:4d538e35eebd 22226:4ed106deb772
453 453
454 call StopShellInTerminal(bufnr('%')) 454 call StopShellInTerminal(bufnr('%'))
455 call delete('Xtest_mks.out') 455 call delete('Xtest_mks.out')
456 endfunc 456 endfunc
457 457
458 func Test_mksession_terminal_shared_windows()
459 terminal
460 let term_buf = bufnr()
461 new
462 execute "buffer" term_buf
463 mksession! Xtest_mks.out
464
465 let lines = readfile('Xtest_mks.out')
466 let found_creation = 0
467 let found_use = 0
468
469 for line in lines
470 if line =~ '^terminal'
471 let found_creation = 1
472 call assert_match('terminal ++curwin ++cols=\d\+ ++rows=\d\+', line)
473 elseif line =~ "^execute 'buffer ' . s:term_buf_" . term_buf . "$"
474 let found_use = 1
475 endif
476 endfor
477
478 call assert_true(found_creation && found_use)
479
480 call StopShellInTerminal(term_buf)
481 call delete('Xtest_mks.out')
482 endfunc
483
458 endif " has('terminal') 484 endif " has('terminal')
459 485
460 " Test :mkview with a file argument. 486 " Test :mkview with a file argument.
461 func Test_mkview_file() 487 func Test_mkview_file()
462 " Create a view with line number and a fold. 488 " Create a view with line number and a fold.