mirror of
https://github.com/neovim/neovim.git
synced 2025-09-05 19:08:15 +00:00
fix(terminal): check size when creating new tabpage
Problem: when creating a new tabpage with a terminal window, terminal size is not updated if there is no statusline. Solution: do not rely on last_status to implicitly call terminal_check_size as a side effect of making room for a statusline; call it directly.
This commit is contained in:
@@ -4279,6 +4279,10 @@ int win_new_tabpage(int after, char *filename)
|
|||||||
newtp->tp_topframe = topframe;
|
newtp->tp_topframe = topframe;
|
||||||
last_status(false);
|
last_status(false);
|
||||||
|
|
||||||
|
if (curbuf->terminal) {
|
||||||
|
terminal_check_size(curbuf->terminal);
|
||||||
|
}
|
||||||
|
|
||||||
redraw_all_later(UPD_NOT_VALID);
|
redraw_all_later(UPD_NOT_VALID);
|
||||||
|
|
||||||
tabpage_check_windows(old_curtab);
|
tabpage_check_windows(old_curtab);
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
local t = require('test.testutil')
|
local t = require('test.testutil')
|
||||||
local n = require('test.functional.testnvim')()
|
local n = require('test.functional.testnvim')()
|
||||||
|
local Screen = require('test.functional.ui.screen')
|
||||||
|
|
||||||
local tt = require('test.functional.testterm')
|
local tt = require('test.functional.testterm')
|
||||||
local feed_data = tt.feed_data
|
local feed_data = tt.feed_data
|
||||||
@@ -383,6 +384,37 @@ describe(':terminal window', function()
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('in new tabpage has correct terminal size', function()
|
||||||
|
screen:set_default_attr_ids({
|
||||||
|
[1] = { reverse = true },
|
||||||
|
[3] = { bold = true },
|
||||||
|
[17] = { background = 2, foreground = Screen.colors.Grey0 },
|
||||||
|
[18] = { background = 2, foreground = 8 },
|
||||||
|
[19] = { underline = true, foreground = Screen.colors.Grey0, background = 7 },
|
||||||
|
[20] = { underline = true, foreground = 5, background = 7 },
|
||||||
|
})
|
||||||
|
|
||||||
|
command('file foo | vsplit')
|
||||||
|
screen:expect([[
|
||||||
|
tty ready │tty ready |
|
||||||
|
rows: 5, cols: 25 │rows: 5, cols: 25 |
|
||||||
|
^ │ |
|
||||||
|
│ |*2
|
||||||
|
{17:foo [-] }{18:foo [-] }|
|
||||||
|
{3:-- TERMINAL --} |
|
||||||
|
]])
|
||||||
|
command('tab split')
|
||||||
|
screen:expect([[
|
||||||
|
{19: }{20:2}{19: foo }{3: foo }{1: }{19:X}|
|
||||||
|
tty ready |
|
||||||
|
rows: 5, cols: 25 |
|
||||||
|
rows: 5, cols: 50 |
|
||||||
|
^ |
|
||||||
|
|
|
||||||
|
{3:-- TERMINAL --} |
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
it('not unnecessarily redrawn by events', function()
|
it('not unnecessarily redrawn by events', function()
|
||||||
eq('t', eval('mode()'))
|
eq('t', eval('mode()'))
|
||||||
exec_lua(function()
|
exec_lua(function()
|
||||||
|
Reference in New Issue
Block a user