aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/mouse_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-01-26 12:37:38 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2019-01-27 12:07:06 +0100
commit30bd1c1e85d2fcffa24a87803bec3070e52c7c7e (patch)
tree4a959f9ee8a6050bc7755cc169be5079724c574b /test/functional/terminal/mouse_spec.lua
parent2ab70cb55c80b17fb4100dd7f2d056131c02b08b (diff)
downloadrneovim-30bd1c1e85d2fcffa24a87803bec3070e52c7c7e.tar.gz
rneovim-30bd1c1e85d2fcffa24a87803bec3070e52c7c7e.tar.bz2
rneovim-30bd1c1e85d2fcffa24a87803bec3070e52c7c7e.zip
terminal: handle size when switching buffers in window
Diffstat (limited to 'test/functional/terminal/mouse_spec.lua')
-rw-r--r--test/functional/terminal/mouse_spec.lua79
1 files changed, 57 insertions, 22 deletions
diff --git a/test/functional/terminal/mouse_spec.lua b/test/functional/terminal/mouse_spec.lua
index 263a5ce79d..5cd8c729cb 100644
--- a/test/functional/terminal/mouse_spec.lua
+++ b/test/functional/terminal/mouse_spec.lua
@@ -108,41 +108,42 @@ describe('terminal mouse', function()
]])
feed(':enew | set number<cr>')
screen:expect([[
- {7: 1 }^ │line28 |
- {4:~ }│line29 |
+ {7: 1 }^ │line29 |
{4:~ }│line30 |
{4:~ }│rows: 5, cols: 25 |
+ {4:~ }│rows: 5, cols: 24 |
{4:~ }│{2: } |
========== ========== |
:enew | set number |
]])
feed('30iline\n<esc>')
screen:expect([[
- {7: 27 }line │line28 |
- {7: 28 }line │line29 |
- {7: 29 }line │line30 |
- {7: 30 }line │rows: 5, cols: 25 |
+ {7: 27 }line │line29 |
+ {7: 28 }line │line30 |
+ {7: 29 }line │rows: 5, cols: 25 |
+ {7: 30 }line │rows: 5, cols: 24 |
{7: 31 }^ │{2: } |
========== ========== |
|
]])
feed('<c-w>li')
screen:expect([[
- {7: 27 }line │line28 |
- {7: 28 }line │line29 |
- {7: 29 }line │line30 |
- {7: 30 }line │rows: 5, cols: 25 |
+ {7: 27 }line │line29 |
+ {7: 28 }line │line30 |
+ {7: 29 }line │rows: 5, cols: 25 |
+ {7: 30 }line │rows: 5, cols: 24 |
{7: 31 } │{1: } |
========== ========== |
{3:-- TERMINAL --} |
]])
+
-- enabling mouse won't affect interaction with other windows
thelpers.enable_mouse()
thelpers.feed_data('mouse enabled\n')
screen:expect([[
- {7: 27 }line │line29 |
- {7: 28 }line │line30 |
- {7: 29 }line │rows: 5, cols: 25 |
+ {7: 27 }line │line30 |
+ {7: 28 }line │rows: 5, cols: 25 |
+ {7: 29 }line │rows: 5, cols: 24 |
{7: 30 }line │mouse enabled |
{7: 31 } │{1: } |
========== ========== |
@@ -153,9 +154,9 @@ describe('terminal mouse', function()
it('wont lose focus if another window is scrolled', function()
feed('<ScrollWheelUp><0,0><ScrollWheelUp><0,0>')
screen:expect([[
- {7: 21 }line │line29 |
- {7: 22 }line │line30 |
- {7: 23 }line │rows: 5, cols: 25 |
+ {7: 21 }line │line30 |
+ {7: 22 }line │rows: 5, cols: 25 |
+ {7: 23 }line │rows: 5, cols: 24 |
{7: 24 }line │mouse enabled |
{7: 25 }line │{1: } |
========== ========== |
@@ -163,9 +164,9 @@ describe('terminal mouse', function()
]])
feed('<S-ScrollWheelDown><0,0>')
screen:expect([[
- {7: 26 }line │line29 |
- {7: 27 }line │line30 |
- {7: 28 }line │rows: 5, cols: 25 |
+ {7: 26 }line │line30 |
+ {7: 27 }line │rows: 5, cols: 25 |
+ {7: 28 }line │rows: 5, cols: 24 |
{7: 29 }line │mouse enabled |
{7: 30 }line │{1: } |
========== ========== |
@@ -176,15 +177,49 @@ describe('terminal mouse', function()
it('will lose focus if another window is clicked', function()
feed('<LeftMouse><5,1>')
screen:expect([[
- {7: 27 }line │line29 |
- {7: 28 }l^ine │line30 |
- {7: 29 }line │rows: 5, cols: 25 |
+ {7: 27 }line │line30 |
+ {7: 28 }l^ine │rows: 5, cols: 25 |
+ {7: 29 }line │rows: 5, cols: 24 |
{7: 30 }line │mouse enabled |
{7: 31 } │{2: } |
========== ========== |
|
]])
end)
+
+ it('handles terminal size when switching buffers', function()
+ nvim('set_option', 'hidden', true)
+ feed('<c-\\><c-n><c-w><c-w>')
+ screen:expect([[
+ {7: 27 }line │line30 |
+ {7: 28 }line │rows: 5, cols: 25 |
+ {7: 29 }line │rows: 5, cols: 24 |
+ {7: 30 }line │mouse enabled |
+ {7: 31 }^ │{2: } |
+ ========== ========== |
+ |
+ ]])
+ feed(':bn<cr>')
+ screen:expect([[
+ rows: 5, cols: 25 │rows: 5, cols: 25 |
+ rows: 5, cols: 24 │rows: 5, cols: 24 |
+ mouse enabled │mouse enabled |
+ rows: 5, cols: 25 │rows: 5, cols: 25 |
+ {2:^ } │{2: } |
+ ========== ========== |
+ :bn |
+ ]])
+ feed(':bn<cr>')
+ screen:expect([[
+ {7: 27 }line │rows: 5, cols: 24 |
+ {7: 28 }line │mouse enabled |
+ {7: 29 }line │rows: 5, cols: 25 |
+ {7: 30 }line │rows: 5, cols: 24 |
+ {7: 31 }^ │{2: } |
+ ========== ========== |
+ :bn |
+ ]])
+ end)
end)
end)
end)