diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-11-13 02:06:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-13 02:06:32 +0100 |
commit | e6beb60da517b6d7d7461687bf91f87d097b9563 (patch) | |
tree | 82619e74c1c5c2ce5c55c9c2d860fee95dd03575 /test/functional/terminal/window_split_tab_spec.lua | |
parent | 20c672a4604bc400229c52795a8488cd034ed1b4 (diff) | |
download | rneovim-e6beb60da517b6d7d7461687bf91f87d097b9563.tar.gz rneovim-e6beb60da517b6d7d7461687bf91f87d097b9563.tar.bz2 rneovim-e6beb60da517b6d7d7461687bf91f87d097b9563.zip |
:terminal : fix crash on resize (#7547)
closes #7538
Fix wrong window references from #7440
Remove some eager resizing. Still mostly doesn't address #4997.
Diffstat (limited to 'test/functional/terminal/window_split_tab_spec.lua')
-rw-r--r-- | test/functional/terminal/window_split_tab_spec.lua | 91 |
1 files changed, 44 insertions, 47 deletions
diff --git a/test/functional/terminal/window_split_tab_spec.lua b/test/functional/terminal/window_split_tab_spec.lua index c5199f620e..714c2476ce 100644 --- a/test/functional/terminal/window_split_tab_spec.lua +++ b/test/functional/terminal/window_split_tab_spec.lua @@ -3,6 +3,9 @@ local thelpers = require('test.functional.terminal.helpers') local clear = helpers.clear local feed, nvim = helpers.feed, helpers.nvim local feed_command = helpers.feed_command +local command = helpers.command +local eq = helpers.eq +local eval = helpers.eval describe('terminal', function() local screen @@ -22,72 +25,66 @@ describe('terminal', function() screen:detach() end) - it('resets its size when entering terminal window', function() + it('next to a closing window', function() + command('split') + command('terminal') + command('vsplit foo') + eq(3, eval("winnr('$')")) + feed('ZQ') -- Close split, should not crash. #7538 + eq(2, eval("1+1")) -- Still alive? + end) + + it('does not change size on WinEnter', function() if helpers.pending_win32(pending) then return end feed('<c-\\><c-n>') feed_command('2split') screen:expect([[ - rows: 2, cols: 50 | - {2:^ } | - ========== | - rows: 2, cols: 50 | - {2: } | - {4:~ }| - {4:~ }| - {4:~ }| - ========== | - :2split | - ]]) - feed_command('wincmd p') - screen:expect([[ tty ready | - rows: 2, cols: 50 | + ^rows: 5, cols: 50 | ========== | tty ready | - rows: 2, cols: 50 | rows: 5, cols: 50 | {2: } | - ^ | + | + | ========== | - :wincmd p | + :2split | ]]) feed_command('wincmd p') screen:expect([[ - rows: 2, cols: 50 | - {2:^ } | + tty ready | + rows: 5, cols: 50 | ========== | - rows: 2, cols: 50 | + tty ready | + ^rows: 5, cols: 50 | {2: } | - {4:~ }| - {4:~ }| - {4:~ }| + | + | ========== | :wincmd p | ]]) end) - describe('when the screen is resized', function() - it('will forward a resize request to the program', function() - feed([[<C-\><C-N>:]]) -- Go to cmdline-mode, so cursor is at bottom. - screen:try_resize(screen._width - 3, screen._height - 2) - screen:expect([[ - tty ready | - rows: 7, cols: 47 | - {2: } | - | - | - | - | - :^ | - ]]) - screen:try_resize(screen._width - 6, screen._height - 3) - screen:expect([[ - tty ready | - rows: 7, cols: 47 | - rows: 4, cols: 41 | - {2: } | - :^ | - ]]) - end) + it('forwards resize request to the program', function() + feed([[<C-\><C-N>:]]) -- Go to cmdline-mode, so cursor is at bottom. + screen:try_resize(screen._width - 3, screen._height - 2) + screen:expect([[ + tty ready | + rows: 7, cols: 47 | + {2: } | + | + | + | + | + :^ | + ]]) + screen:try_resize(screen._width - 6, screen._height - 3) + screen:expect([[ + tty ready | + rows: 7, cols: 47 | + rows: 4, cols: 41 | + {2: } | + :^ | + ]]) end) end) |