aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-05-01 20:08:25 +0200
committerLuuk van Baal <luukvbaal@gmail.com>2023-05-03 14:58:25 +0200
commit197827321a39168dbaa143c9f7b4f5db668f893c (patch)
tree59df2204df7c47c19b611417319bd804b3c8bbe4 /test
parent066db5e7cdaadfb1d2971bdc4b9200f14737d7b6 (diff)
downloadrneovim-197827321a39168dbaa143c9f7b4f5db668f893c.tar.gz
rneovim-197827321a39168dbaa143c9f7b4f5db668f893c.tar.bz2
rneovim-197827321a39168dbaa143c9f7b4f5db668f893c.zip
fix(tui): grid_clear properly clears the screen
Problem: When setting a shell size smaller than the containing terminal window through `:winsize` or `:set lines/columns` the screen is not properly cleared. Solution: Clear the tui dimensions rather than the grid dimensions.
Diffstat (limited to 'test')
-rw-r--r--test/functional/terminal/api_spec.lua8
-rw-r--r--test/functional/terminal/tui_spec.lua13
2 files changed, 17 insertions, 4 deletions
diff --git a/test/functional/terminal/api_spec.lua b/test/functional/terminal/api_spec.lua
index 724791343d..93641fc576 100644
--- a/test/functional/terminal/api_spec.lua
+++ b/test/functional/terminal/api_spec.lua
@@ -66,10 +66,10 @@ describe('api', function()
screen:expect([[
[tui] insert-mode |
- [socket 1] this is more t{4: }|
- han 25 columns {4: }|
- [socket 2] input{1: } {4: }|
- {4:~ }|
+ [socket 1] this is more t |
+ han 25 columns |
+ [socket 2] input{1: } |
+ {4:~ } |
{3:-- INSERT --} |
{3:-- TERMINAL --} |
]])
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index 069fbad803..5fd3467949 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -2422,6 +2422,19 @@ describe("TUI as a client", function()
{3:-- TERMINAL --} |
]]}
+ -- grid smaller than containing terminal window is cleared properly
+ feed_data(":call setline(1,['a'->repeat(&columns)]->repeat(&lines))\n")
+ feed_data("0:set lines=2\n")
+ screen_server:expect{grid=[[
+ {1:a}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {5:[No Name] [+] }|
+ |
+ |
+ |
+ |
+ {3:-- TERMINAL --} |
+ ]]}
+
feed_data(":q!\n")
server_super:close()