diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-11 22:10:22 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-11 22:10:22 +0200 |
commit | c2c820563441499892359da949db3c8f7f16d109 (patch) | |
tree | f88cf9df9ee8a6c4cdbbf236f9a2ff2d6b400070 /src/testdir/test_mksession.vim | |
parent | 14944c04bd15f3bc67a6665d7234e44bd77b495d (diff) | |
download | vim-git-c2c820563441499892359da949db3c8f7f16d109.tar.gz |
patch 8.2.1664: memory leak when using :mkview with a terminal bufferv8.2.1664
Problem: Memory leak when using :mkview with a terminal buffer.
Solution: Don't use a hastab for :mkview. (Rob Pilling, closes #6935)
Diffstat (limited to 'src/testdir/test_mksession.vim')
-rw-r--r-- | src/testdir/test_mksession.vim | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim index 66cbca15a..06be83829 100644 --- a/src/testdir/test_mksession.vim +++ b/src/testdir/test_mksession.vim @@ -351,9 +351,8 @@ func Test_mksession_blank_windows() call delete('Xtest_mks.out') endfunc -if has('terminal') - func Test_mksession_terminal_shell() + CheckFeature terminal CheckFeature quickfix terminal @@ -374,6 +373,8 @@ func Test_mksession_terminal_shell() endfunc func Test_mksession_terminal_no_restore_cmdarg() + CheckFeature terminal + terminal ++norestore mksession! Xtest_mks.out let lines = readfile('Xtest_mks.out') @@ -389,6 +390,8 @@ func Test_mksession_terminal_no_restore_cmdarg() endfunc func Test_mksession_terminal_no_restore_funcarg() + CheckFeature terminal + call term_start(&shell, {'norestore': 1}) mksession! Xtest_mks.out let lines = readfile('Xtest_mks.out') @@ -404,6 +407,8 @@ func Test_mksession_terminal_no_restore_funcarg() endfunc func Test_mksession_terminal_no_restore_func() + CheckFeature terminal + terminal call term_setrestore(bufnr('%'), 'NONE') mksession! Xtest_mks.out @@ -420,6 +425,8 @@ func Test_mksession_terminal_no_restore_func() endfunc func Test_mksession_terminal_no_ssop() + CheckFeature terminal + terminal set sessionoptions-=terminal mksession! Xtest_mks.out @@ -437,6 +444,7 @@ func Test_mksession_terminal_no_ssop() endfunc func Test_mksession_terminal_restore_other() + CheckFeature terminal CheckFeature quickfix terminal @@ -456,6 +464,8 @@ func Test_mksession_terminal_restore_other() endfunc func Test_mksession_terminal_shared_windows() + CheckFeature terminal + terminal let term_buf = bufnr() new @@ -481,7 +491,18 @@ func Test_mksession_terminal_shared_windows() call delete('Xtest_mks.out') endfunc -endif " has('terminal') +func Test_mkview_terminal_windows() + CheckFeature terminal + + " create two window on the same terminal to check this is handled OK + terminal + let term_buf = bufnr() + exe 'sbuf ' .. term_buf + mkview! Xtestview + + call StopShellInTerminal(term_buf) + call delete('Xtestview') +endfunc " Test :mkview with a file argument. func Test_mkview_file() |