diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-01-25 18:44:29 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-01-27 12:07:06 +0100 |
commit | 2ab70cb55c80b17fb4100dd7f2d056131c02b08b (patch) | |
tree | e3a4cc06776b51d1ec4e9733d377452d0158b4c3 /test/functional/terminal/window_spec.lua | |
parent | 80b75bc99aeb6ecc40e59343ec527443d882e8ec (diff) | |
download | rneovim-2ab70cb55c80b17fb4100dd7f2d056131c02b08b.tar.gz rneovim-2ab70cb55c80b17fb4100dd7f2d056131c02b08b.tar.bz2 rneovim-2ab70cb55c80b17fb4100dd7f2d056131c02b08b.zip |
window/ui: reorganize size variables, fix terminal window size with multigrid.
wp->w_height_inner now contains the "inner" size, regardless if the
window has been drawn yet or not. It should be used instead of
wp->w_grid.Rows, for stuff that is not directly related to accessing
the allocated grid memory, such like cursor movement and terminal size
Diffstat (limited to 'test/functional/terminal/window_spec.lua')
-rw-r--r-- | test/functional/terminal/window_spec.lua | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/test/functional/terminal/window_spec.lua b/test/functional/terminal/window_spec.lua index 842a81872e..242377f9bd 100644 --- a/test/functional/terminal/window_spec.lua +++ b/test/functional/terminal/window_spec.lua @@ -124,3 +124,101 @@ describe('terminal window', function() end) end) +describe('terminal window with multigrid', function() + local screen + + before_each(function() + clear() + screen = thelpers.screen_setup(0,nil,50,{ext_multigrid=true}) + end) + + it('resizes to requested size', function() + screen:expect([[ + ## grid 1 + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + {3:-- TERMINAL --} | + ## grid 2 + tty ready | + {1: } | + | + | + | + | + ]]) + + screen:try_resize_grid(2, 20, 10) + if iswin() then + screen:expect{any="rows: 10, cols: 20"} + else + screen:expect([[ + ## grid 1 + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + {3:-- TERMINAL --} | + ## grid 2 + tty ready | + rows: 10, cols: 20 | + {1: } | + | + | + | + | + | + | + | + ]]) + end + + screen:try_resize_grid(2, 70, 3) + if iswin() then + screen:expect{any="rows: 3, cols: 70"} + else + screen:expect([[ + ## grid 1 + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + {3:-- TERMINAL --} | + ## grid 2 + rows: 10, cols: 20 | + rows: 3, cols: 70 | + {1: } | + ]]) + end + + screen:try_resize_grid(2, 0, 0) + if iswin() then + screen:expect{any="rows: 6, cols: 50"} + else + screen:expect([[ + ## grid 1 + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + {3:-- TERMINAL --} | + ## grid 2 + tty ready | + rows: 10, cols: 20 | + rows: 3, cols: 70 | + rows: 6, cols: 50 | + {1: } | + | + ]]) + end + end) +end) |