aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/window_spec.lua
diff options
context:
space:
mode:
authorAndrew Pyatkov <mrbiggfoot@gmail.com>2018-04-28 16:39:21 -0700
committerJustin M. Keyes <justinkz@gmail.com>2019-01-29 03:00:48 +0100
commit894f6bee54e80811f95b8767327d39ab277a4866 (patch)
tree2e68b87f74f971b6cd7d82dd3a35df95cd128fa4 /test/functional/terminal/window_spec.lua
parent28f87c505d895df8d00a919f6324f5305f02166e (diff)
downloadrneovim-894f6bee54e80811f95b8767327d39ab277a4866.tar.gz
rneovim-894f6bee54e80811f95b8767327d39ab277a4866.tar.bz2
rneovim-894f6bee54e80811f95b8767327d39ab277a4866.zip
:terminal : set topline based on window height #8325
closes #8324 closes #8556
Diffstat (limited to 'test/functional/terminal/window_spec.lua')
-rw-r--r--test/functional/terminal/window_spec.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/functional/terminal/window_spec.lua b/test/functional/terminal/window_spec.lua
index 242377f9bd..c220b0c5a4 100644
--- a/test/functional/terminal/window_spec.lua
+++ b/test/functional/terminal/window_spec.lua
@@ -3,8 +3,12 @@ local thelpers = require('test.functional.terminal.helpers')
local feed, clear = helpers.feed, helpers.clear
local wait = helpers.wait
local iswin = helpers.iswin
+local command = helpers.command
+local retry = helpers.retry
+local eq = helpers.eq
+local eval = helpers.eval
-describe('terminal window', function()
+describe(':terminal window', function()
local screen
before_each(function()
@@ -12,6 +16,19 @@ describe('terminal window', function()
screen = thelpers.screen_setup()
end)
+ it('sets topline correctly #8556', function()
+ -- Test has hardcoded assumptions of dimensions.
+ eq(7, eval('&lines'))
+ command('set shell=sh')
+ command('terminal')
+ retry(nil, nil, function() assert(nil ~= eval('b:terminal_job_pid')) end)
+ -- Terminal/shell contents must exceed the height of this window.
+ command('topleft 1split')
+ feed([[i<cr>]])
+ -- Check topline _while_ in terminal-mode.
+ retry(nil, nil, function() eq(6, eval('winsaveview()["topline"]')) end)
+ end)
+
describe("with 'number'", function()
it('wraps text', function()
feed([[<C-\><C-N>]])
@@ -124,7 +141,7 @@ describe('terminal window', function()
end)
end)
-describe('terminal window with multigrid', function()
+describe(':terminal with multigrid', function()
local screen
before_each(function()