diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-09-01 11:25:00 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-09-01 15:55:10 +0200 |
commit | e04b9e7c78bdcf40cce5b5533ce8d7695691dfd6 (patch) | |
tree | 39dd100dccde24ce0b8af578e134b5d2b945faa9 | |
parent | b51ba122c1edfb769e72c25c4f14f469f59f1b8e (diff) | |
download | rneovim-e04b9e7c78bdcf40cce5b5533ce8d7695691dfd6.tar.gz rneovim-e04b9e7c78bdcf40cce5b5533ce8d7695691dfd6.tar.bz2 rneovim-e04b9e7c78bdcf40cce5b5533ce8d7695691dfd6.zip |
test/ui: update tests for new msg_grid implementation
-rw-r--r-- | test/functional/eval/timer_spec.lua | 1 | ||||
-rw-r--r-- | test/functional/terminal/helpers.lua | 2 | ||||
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 79 | ||||
-rw-r--r-- | test/functional/terminal/window_spec.lua | 16 | ||||
-rw-r--r-- | test/functional/ui/cursor_spec.lua | 4 | ||||
-rw-r--r-- | test/functional/ui/embed_spec.lua | 3 | ||||
-rw-r--r-- | test/functional/ui/float_spec.lua | 952 | ||||
-rw-r--r-- | test/functional/ui/highlight_spec.lua | 75 | ||||
-rw-r--r-- | test/functional/ui/hlstate_spec.lua | 38 | ||||
-rw-r--r-- | test/functional/ui/multigrid_spec.lua | 952 | ||||
-rw-r--r-- | test/functional/ui/popupmenu_spec.lua | 50 | ||||
-rw-r--r-- | test/functional/ui/screen.lua | 33 |
12 files changed, 1390 insertions, 815 deletions
diff --git a/test/functional/eval/timer_spec.lua b/test/functional/eval/timer_spec.lua index 26ed42eac4..48d10e46a9 100644 --- a/test/functional/eval/timer_spec.lua +++ b/test/functional/eval/timer_spec.lua @@ -222,6 +222,7 @@ describe('timers', function() let g:val = 0 func! MyHandler(timer) echo "evil" + redraw let g:val = 1 endfunc ]]) diff --git a/test/functional/terminal/helpers.lua b/test/functional/terminal/helpers.lua index 2d99a08614..9e450cc264 100644 --- a/test/functional/terminal/helpers.lua +++ b/test/functional/terminal/helpers.lua @@ -56,6 +56,8 @@ local function screen_setup(extra_rows, command, cols, opts) [8] = {foreground = 15, background = 1}, -- error message [9] = {foreground = 4}, [10] = {foreground = 121}, -- "Press ENTER" in embedded :terminal session. + [11] = {foreground = tonumber('0x00000b')}, + [12] = {reverse = true, foreground = tonumber('0x000079')}, }) screen:attach(opts or {rgb=false}) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 07c91d43e1..cbf113d062 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -89,6 +89,85 @@ describe('TUI', function() eq(2, eval("1+1")) -- Still alive? end) + it('accepts resize while pager is active', function() + child_session:request("nvim_command", [[ + set more + func! ManyErr() + for i in range(10) + echoerr "FAIL ".i + endfor + endfunc + ]]) + feed_data(':call ManyErr()\r') + screen:expect{grid=[[ + {8:Error detected while processing function ManyErr:} | + {11:line 2:} | + {8:FAIL 0} | + {8:FAIL 1} | + {8:FAIL 2} | + {10:-- More --}{1: } | + {3:-- TERMINAL --} | + ]]} + + feed_data('d') + screen:expect{grid=[[ + {8:FAIL 1} | + {8:FAIL 2} | + {8:FAIL 3} | + {8:FAIL 4} | + {8:FAIL 5} | + {10:-- More --}{1: } | + {3:-- TERMINAL --} | + ]]} + + screen:try_resize(50,5) + screen:expect{grid=[[ + {8:FAIL 1} | + {8:FAIL 2} | + {8:FAIL 3} | + {10:-- More -- SPACE/d/j: screen/page/line down, b/u/}{12:k}| + {3:-- TERMINAL --} | + ]]} + + -- TODO(bfredl): messes up the output (just like vim does). + feed_data('g') + screen:expect{grid=[[ + {8:FAIL 1} ) | + {8:Error detected while processing function ManyErr:} | + {11:line 2:} | + {10:-- More --}{1: } | + {3:-- TERMINAL --} | + ]]} + + screen:try_resize(50,10) + screen:expect{grid=[[ + {8:FAIL 1} ) | + {8:Error detected while processing function ManyErr:} | + {11:line 2:} | + {10:-- More --} | + {10: }| + {10: }| + {10: }| + {10: }| + {10:-- More -- SPACE/d/j: screen/page/line down, b/u/}{12:k}| + {3:-- TERMINAL --} | + ]]} + + feed_data('\003') + screen:expect{grid=[[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + | + {3:-- TERMINAL --} | + ]]} + end) + it('accepts basic utf-8 input', function() feed_data('iabc\ntest1\ntest2') screen:expect([[ diff --git a/test/functional/terminal/window_spec.lua b/test/functional/terminal/window_spec.lua index 4f62c75433..f1c828d17e 100644 --- a/test/functional/terminal/window_spec.lua +++ b/test/functional/terminal/window_spec.lua @@ -158,7 +158,7 @@ describe(':terminal with multigrid', function() [2:--------------------------------------------------]| [2:--------------------------------------------------]| [2:--------------------------------------------------]| - {3:-- TERMINAL --} | + [3:--------------------------------------------------]| ## grid 2 tty ready | {1: } | @@ -166,6 +166,8 @@ describe(':terminal with multigrid', function() | | | + ## grid 3 + {3:-- TERMINAL --} | ]]) screen:try_resize_grid(2, 20, 10) @@ -180,7 +182,7 @@ describe(':terminal with multigrid', function() [2:--------------------------------------------------]| [2:--------------------------------------------------]| [2:--------------------------------------------------]| - {3:-- TERMINAL --} | + [3:--------------------------------------------------]| ## grid 2 tty ready | rows: 10, cols: 20 | @@ -192,6 +194,8 @@ describe(':terminal with multigrid', function() | | | + ## grid 3 + {3:-- TERMINAL --} | ]]) end @@ -207,11 +211,13 @@ describe(':terminal with multigrid', function() [2:--------------------------------------------------]| [2:--------------------------------------------------]| [2:--------------------------------------------------]| - {3:-- TERMINAL --} | + [3:--------------------------------------------------]| ## grid 2 rows: 10, cols: 20 | rows: 3, cols: 70 | {1: } | + ## grid 3 + {3:-- TERMINAL --} | ]]) end @@ -227,7 +233,7 @@ describe(':terminal with multigrid', function() [2:--------------------------------------------------]| [2:--------------------------------------------------]| [2:--------------------------------------------------]| - {3:-- TERMINAL --} | + [3:--------------------------------------------------]| ## grid 2 tty ready | rows: 10, cols: 20 | @@ -235,6 +241,8 @@ describe(':terminal with multigrid', function() rows: 6, cols: 50 | {1: } | | + ## grid 3 + {3:-- TERMINAL --} | ]]) end end) diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua index 6475eb2923..67aba919b0 100644 --- a/test/functional/ui/cursor_spec.lua +++ b/test/functional/ui/cursor_spec.lua @@ -216,10 +216,10 @@ describe('ui/cursor', function() if m.blinkwait then m.blinkwait = 700 end end if m.hl_id then - m.hl_id = 54 + m.hl_id = 55 m.attr = {background = Screen.colors.DarkGray} end - if m.id_lm then m.id_lm = 55 end + if m.id_lm then m.id_lm = 56 end end -- Assert the new expectation. diff --git a/test/functional/ui/embed_spec.lua b/test/functional/ui/embed_spec.lua index 9196c8af40..0f50baa73f 100644 --- a/test/functional/ui/embed_spec.lua +++ b/test/functional/ui/embed_spec.lua @@ -18,6 +18,7 @@ local function test_embed(ext_linegrid) [2] = {bold = true, foreground = Screen.colors.SeaGreen4}, [3] = {bold = true, foreground = Screen.colors.Blue1}, [4] = {bold = true, foreground = Screen.colors.Green}, + [5] = {bold = true, reverse = true}, }) end @@ -53,7 +54,7 @@ local function test_embed(ext_linegrid) | | | - | + {5: }| Error detected while processing pre-vimrc command line: | foo | {1:bar} | diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 8dfe36c799..958c56334a 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -67,7 +67,7 @@ describe('floating windows', function() local buf = meths.create_buf(false,false) local win = meths.open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) local expected_pos = { - [3]={{id=1001}, 'NW', 1, 2, 5, true}, + [4]={{id=1001}, 'NW', 1, 2, 5, true}, } if multigrid then @@ -79,7 +79,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^ | {0:~ }| @@ -88,6 +88,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1: }| {2:~ }| ]], float_pos=expected_pos} @@ -105,8 +107,8 @@ describe('floating windows', function() meths.win_set_config(win, {relative='editor', row=0, col=10}) - expected_pos[3][4] = 0 - expected_pos[3][5] = 10 + expected_pos[4][4] = 0 + expected_pos[4][5] = 10 if multigrid then screen:expect{grid=[[ ## grid 1 @@ -116,7 +118,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^ | {0:~ }| @@ -125,6 +127,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1: }| {2:~ }| ]], float_pos=expected_pos} @@ -150,7 +154,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^ | {0:~ }| @@ -158,6 +162,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| + ## grid 3 + | ]]) else screen:expect([[ @@ -182,7 +188,7 @@ describe('floating windows', function() local buf = meths.create_buf(false,false) local win = meths.open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) local expected_pos = { - [3]={{id=1001}, 'NW', 1, 2, 5, true}, + [4]={{id=1001}, 'NW', 1, 2, 5, true}, } if multigrid then @@ -194,7 +200,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^ | {0:~ }| @@ -203,6 +209,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1: }| {2:~ }| ]], float_pos=expected_pos} @@ -220,8 +228,8 @@ describe('floating windows', function() meths.win_set_config(win, {relative='editor', row=0, col=10}) - expected_pos[3][4] = 0 - expected_pos[3][5] = 10 + expected_pos[4][4] = 0 + expected_pos[4][5] = 10 if multigrid then screen:expect{grid=[[ ## grid 1 @@ -231,7 +239,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^ | {0:~ }| @@ -240,6 +248,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1: }| {2:~ }| ]], float_pos=expected_pos} @@ -265,7 +275,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^ | {0:~ }| @@ -273,6 +283,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| + ## grid 3 + | ]]) else screen:expect([[ @@ -315,7 +327,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 {14: 1 }^x | {14: 2 }y | @@ -324,11 +336,13 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {18: 1 }{15:x }| {18: 2 }{15:y }| {18: 3 }{15: }| {16:~ }| - ]], float_pos={[3] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} else screen:expect([[ {14: 1 }^x | @@ -352,7 +366,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 {14: 1 }^x | {14: 2 }y | @@ -361,11 +375,13 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {18: 1 }{15: }| {16:~ }| {16:~ }| {16:~ }| - ]], float_pos={[3] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} else screen:expect([[ {14: 1 }^x | @@ -396,7 +412,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 {19: }{20: 1 }{21:^x }| {19: }{14: 2 }y | @@ -405,11 +421,13 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {15:x }| {15:y }| {15: }| {15: }| - ]], float_pos={[3] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} else screen:expect{grid=[[ {19: }{20: 1 }{21:^x }| @@ -434,7 +452,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 {19: }{17:𐌢̀́̂̃̅̄𐌢̀́̂̃̅̄}{20: 1 }{21:^x }| {19: }{14: 2 }y | @@ -443,11 +461,13 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {17:𐌢̀́̂̃̅̄𐌢̀́̂̃̅̄}{15:x }| {19: }{15:y }| {19: }{15: }| {15: }| - ]], float_pos={[3] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} else screen:expect([[ @@ -473,7 +493,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 {19: }{20: 1 }{21:^x }| {19: }{14: 2 }y | @@ -482,11 +502,13 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {15: }| {15: }| {15: }| {15: }| - ]], float_pos={[3] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} else screen:expect([[ {19: }{20: 1 }{21:^x }| @@ -514,7 +536,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 the background tex^t | {0:~ }| @@ -522,10 +544,12 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:x}| ]], float_pos={ - [4] = {{id = 1002}, "NW", 2, 0, 4, false} + [5] = {{id = 1002}, "NW", 2, 0, 4, false} }} else screen:expect([[ @@ -549,7 +573,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 the background tex^t | {0:~ }| @@ -557,10 +581,12 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:x}| ]], float_pos={ - [4] = {{id = 1002}, "NW", 2, 0, 15, false} + [5] = {{id = 1002}, "NW", 2, 0, 15, false} }} else screen:expect([[ @@ -584,7 +610,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 the background tex^t | {0:~ }| @@ -592,6 +618,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| + ## grid 3 + | ]]) else screen:expect([[ @@ -643,16 +671,18 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - [3:----------------------------------------]| - [3:----------------------------------------]| - [3:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| {4:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 just some | example text | {0:~ }| ## grid 3 + | + ## grid 4 jus^t some | example text | {0:~ }| @@ -681,24 +711,26 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - [3:----------------------------------------]| - [3:----------------------------------------]| - [3:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| {4:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 just some | example text | {0:~ }| ## grid 3 + | + ## grid 4 jus^t some | example text | {0:~ }| - ## grid 4 + ## grid 5 {1: }| {2:~ }| ]], float_pos={ - [4] = {{id = 1002}, "NW", 3, 0, 10, true} + [5] = {{id = 1002}, "NW", 4, 0, 10, true} }} else screen:expect([[ @@ -722,24 +754,26 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - [3:----------------------------------------]| - [3:----------------------------------------]| - [3:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| {4:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 just some | example text | {0:~ }| ## grid 3 + | + ## grid 4 jus^t some | example text | {0:~ }| - ## grid 4 + ## grid 5 {1: }| {2:~ }| ]], float_pos={ - [4] = {{id = 1002}, "NW", 3, 1, 1, true} + [5] = {{id = 1002}, "NW", 4, 1, 1, true} }} else screen:expect([[ @@ -763,24 +797,26 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - [3:----------------------------------------]| - [3:----------------------------------------]| - [3:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| {4:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 just some | example text | {0:~ }| ## grid 3 + | + ## grid 4 jus^t some | example text | {0:~ }| - ## grid 4 + ## grid 5 {1: }| {2:~ }| ]], float_pos={ - [4] = {{id = 1002}, "SW", 3, 0, 3, true} + [5] = {{id = 1002}, "SW", 4, 0, 3, true} }} else screen:expect([[ @@ -805,24 +841,26 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - [3:----------------------------------------]| - [3:----------------------------------------]| - [3:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| {4:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 just some | example text | {0:~ }| ## grid 3 + | + ## grid 4 jus^t some | example text | {0:~ }| - ## grid 4 + ## grid 5 {1: }| {2:~ }| ]], float_pos={ - [4] = {{id = 1002}, "NW", 2, 1, 10, true} + [5] = {{id = 1002}, "NW", 2, 1, 10, true} }} else screen:expect([[ @@ -846,24 +884,26 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - [3:----------------------------------------]| - [3:----------------------------------------]| - [3:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| {4:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 just some | example text | {0:~ }| ## grid 3 + | + ## grid 4 jus^t some | example text | {0:~ }| - ## grid 4 + ## grid 5 {1: }| {2:~ }| ]], float_pos={ - [4] = {{id = 1002}, "SE", 2, 3, 39, true} + [5] = {{id = 1002}, "SE", 2, 3, 39, true} }} else screen:expect([[ @@ -887,24 +927,26 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - [3:----------------------------------------]| - [3:----------------------------------------]| - [3:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| {4:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 just some | example text | {0:~ }| ## grid 3 + | + ## grid 4 jus^t some | example text | {0:~ }| - ## grid 4 + ## grid 5 {1: }| {2:~ }| ]], float_pos={ - [4] = {{id = 1002}, "NE", 3, 0, 50, true} + [5] = {{id = 1002}, "NE", 4, 0, 50, true} }} else screen:expect([[ @@ -932,12 +974,14 @@ describe('floating windows', function() [2:------------------------------]| [2:------------------------------]| [2:------------------------------]| - | + [3:------------------------------]| ## grid 2 that is wider than the windo^w | {0:~ }| {0:~ }| {0:~ }| + ## grid 3 + | ]]) else screen:expect([[ @@ -959,16 +1003,18 @@ describe('floating windows', function() [2:------------------------------]| [2:------------------------------]| [2:------------------------------]| - | + [3:------------------------------]| ## grid 2 that is wider than the windo^w | {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:some floaty text }| ]], float_pos={ - [4] = {{id = 1002}, "NW", 1, 3, 1, true} + [5] = {{id = 1002}, "NW", 1, 3, 1, true} }} else screen:expect([[ @@ -1024,7 +1070,7 @@ describe('floating windows', function() meths.buf_set_lines(buf, 0, -1, true, {'such', 'very', 'float'}) local win = meths.open_win(buf, false, {relative='editor', width=15, height=4, row=2, col=10}) local expected_pos = { - [4]={{id=1002}, 'NW', 1, 2, 10, true}, + [5]={{id=1002}, 'NW', 1, 2, 10, true}, } if multigrid then screen:expect{grid=[[ @@ -1035,7 +1081,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^ | {0:~ }| @@ -1043,7 +1089,9 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:such }| {1:very }| {1:float }| @@ -1069,13 +1117,15 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^ | {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:such }| {1:very }| {1:float }| @@ -1098,12 +1148,14 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^ | {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:such }| {1:very }| {1:float }| @@ -1124,11 +1176,13 @@ describe('floating windows', function() ## grid 1 [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^ | {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:such }| {1:very }| {1:float }| @@ -1147,11 +1201,13 @@ describe('floating windows', function() ## grid 1 [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 | {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:such }| {1:very }| {1:^float }| @@ -1175,7 +1231,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 | {0:~ }| @@ -1183,7 +1239,9 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:such }| {1:very }| {1:^float }| @@ -1212,7 +1270,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 | {0:~ }| @@ -1220,7 +1278,9 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:^such }| {1:very }| {1:float }| @@ -1247,7 +1307,7 @@ describe('floating windows', function() [2:--------------------------]| [2:--------------------------]| [2:--------------------------]| - | + [3:--------------------------]| ## grid 2 | {0:~ }| @@ -1255,7 +1315,9 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:^such }| {1:very }| {1:float }| @@ -1282,7 +1344,7 @@ describe('floating windows', function() [2:-------------------------]| [2:-------------------------]| [2:-------------------------]| - | + [3:-------------------------]| ## grid 2 | {0:~ }| @@ -1290,7 +1352,9 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:^such }| {1:very }| {1:float }| @@ -1317,7 +1381,7 @@ describe('floating windows', function() [2:------------------------]| [2:------------------------]| [2:------------------------]| - | + [3:------------------------]| ## grid 2 | {0:~ }| @@ -1325,7 +1389,9 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:^such }| {1:very }| {1:float }| @@ -1352,7 +1418,7 @@ describe('floating windows', function() [2:----------------]| [2:----------------]| [2:----------------]| - | + [3:----------------]| ## grid 2 | {0:~ }| @@ -1360,7 +1426,9 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:^such }| {1:very }| {1:float }| @@ -1387,7 +1455,7 @@ describe('floating windows', function() [2:---------------]| [2:---------------]| [2:---------------]| - | + [3:---------------]| ## grid 2 | {0:~ }| @@ -1395,7 +1463,9 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:^such }| {1:very }| {1:float }| @@ -1422,7 +1492,7 @@ describe('floating windows', function() [2:--------------]| [2:--------------]| [2:--------------]| - | + [3:--------------]| ## grid 2 | {0:~ }| @@ -1430,7 +1500,9 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:^such }| {1:very }| {1:float }| @@ -1457,7 +1529,7 @@ describe('floating windows', function() [2:------------]| [2:------------]| [2:------------]| - | + [3:------------]| ## grid 2 | {0:~ }| @@ -1465,7 +1537,9 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:^such }| {1:very }| {1:float }| @@ -1488,10 +1562,12 @@ describe('floating windows', function() screen:expect{grid=[[ ## grid 1 [2:------------]| - | + [3:------------]| ## grid 2 | - ## grid 4 + ## grid 3 + | + ## grid 5 {1:^such }| {1:very }| {1:float }| @@ -1513,7 +1589,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 | {0:~ }| @@ -1521,7 +1597,9 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 {1:^such }| {1:very }| {1:float }| @@ -1541,7 +1619,7 @@ describe('floating windows', function() it('does not crash with inccommand #9379', function() local expected_pos = { - [3]={{id=1001}, 'NW', 1, 2, 0, true}, + [4]={{id=1001}, 'NW', 1, 2, 0, true}, } command("set inccommand=split") @@ -1564,7 +1642,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] }| - | + [3:----------------------------------------]| ## grid 2 | {0:~ }| @@ -1572,6 +1650,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:foo }| {1:bar }| {1:^ }| @@ -1599,10 +1679,12 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[Preview] }| - :%s/.^ | + [3:----------------------------------------]| ## grid 2 | ## grid 3 + :%s/.^ | + ## grid 4 {17:f}{1:oo }| {17:b}{1:ar }| {1: }| @@ -1630,7 +1712,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] }| - | + [3:----------------------------------------]| ## grid 2 | {0:~ }| @@ -1638,6 +1720,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:foo }| {1:bar }| {1:^ }| @@ -1676,7 +1760,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 | {0:~ }| @@ -1685,12 +1769,14 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {7:^ }| {12:~ }| {12:~ }| {12:~ }| ]], float_pos={ - [3] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }} else screen:expect([[ @@ -1717,7 +1803,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 | {0:~ }| @@ -1726,17 +1812,19 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + {3:-- INSERT --} | + ## grid 4 {7:x aa^ }| {12:~ }| {12:~ }| {12:~ }| - ## grid 4 + ## grid 5 {13: aa }| {1: word }| {1: longtext }| ]], float_pos={ - [3] = {{ id = 1001 }, "NW", 1, 2, 5, true}, - [4] = {{ id = -1 }, "NW", 3, 1, 1, false} + [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [5] = {{ id = -1 }, "NW", 4, 1, 1, false} }} else screen:expect([[ @@ -1760,7 +1848,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 | {0:~ }| @@ -1769,12 +1857,14 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {7:x a^a }| {12:~ }| {12:~ }| {12:~ }| ]], float_pos={ - [3] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }} else @@ -1800,7 +1890,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 xx^ | {0:~ }| @@ -1809,17 +1899,19 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + {3:-- INSERT --} | + ## grid 4 {7:x aa }| {12:~ }| {12:~ }| {12:~ }| - ## grid 4 + ## grid 5 {13:xx }| {1:yy }| {1:zz }| ]], float_pos={ - [3] = {{ id = 1001 }, "NW", 1, 2, 5, true}, - [4] = {{ id = -1 }, "NW", 2, 1, 0, false} + [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [5] = {{ id = -1 }, "NW", 2, 1, 0, false} }} else screen:expect([[ @@ -1843,7 +1935,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 xx^ | {0:~ }| @@ -1852,12 +1944,14 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + {3:-- INSERT --} | + ## grid 4 {7:x aa }| {12:~ }| {12:~ }| {12:~ }| ]], float_pos={ - [3] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }} else screen:expect([[ @@ -1886,7 +1980,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 | {0:~ }| @@ -1895,14 +1989,16 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + {3:-- INSERT --} | + ## grid 4 {7:x aa^ }| {12:~ }| {12:~ }| {12:~ }| ]], float_pos={ - [3] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }, popupmenu={ - anchor = {3, 0, 2}, items = items, pos = 0 + anchor = {4, 0, 2}, items = items, pos = 0 }} else screen:expect{grid=[[ @@ -1928,7 +2024,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 | {0:~ }| @@ -1937,12 +2033,14 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {7:x a^a }| {12:~ }| {12:~ }| {12:~ }| ]], float_pos={ - [3] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }} else screen:expect([[ @@ -1968,7 +2066,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 xx^ | {0:~ }| @@ -1977,12 +2075,14 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + {3:-- INSERT --} | + ## grid 4 {7:x aa }| {12:~ }| {12:~ }| {12:~ }| ]], float_pos={ - [3] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }, popupmenu={ anchor = {2, 0, 0}, items = items, pos = 0 }} @@ -2010,7 +2110,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 xx^ | {0:~ }| @@ -2019,12 +2119,14 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + {3:-- INSERT --} | + ## grid 4 {7:x aa }| {12:~ }| {12:~ }| {12:~ }| ]], float_pos={ - [3] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }} else screen:expect([[ @@ -2055,7 +2157,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 aa^ | {0:~ }| @@ -2064,11 +2166,13 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + {3:-- INSERT --} | + ## grid 4 {13:aa }| {1:word }| {1:longtext }| ]], float_pos={ - [3] = {{id = -1}, "NW", 2, 1, 0, false}} + [4] = {{id = -1}, "NW", 2, 1, 0, false}} } else screen:expect([[ @@ -2094,7 +2198,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 aa^ | {0:~ }| @@ -2103,15 +2207,17 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + {3:-- INSERT --} | + ## grid 4 {13:aa }| {1:word }| {1:longtext }| - ## grid 5 + ## grid 6 {15:some info }| {15:about item }| ]], float_pos={ - [3] = {{id = -1}, "NW", 2, 1, 0, false}, - [5] = {{id = 1002}, "NW", 2, 1, 12, true}, + [4] = {{id = -1}, "NW", 2, 1, 0, false}, + [6] = {{id = 1002}, "NW", 2, 1, 12, true}, }} else screen:expect([[ @@ -2137,7 +2243,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 aa^ | {0:~ }| @@ -2145,11 +2251,13 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 5 + ## grid 3 + {3:-- INSERT --} | + ## grid 6 {15:some info }| {15:about item }| ]], float_pos={ - [5] = {{id = 1002}, "NW", 2, 1, 12, true}, + [6] = {{id = 1002}, "NW", 2, 1, 12, true}, }} else screen:expect([[ @@ -2173,7 +2281,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 aa^ | {0:~ }| @@ -2181,6 +2289,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| + ## grid 3 + {3:-- INSERT --} | ]]) else screen:expect([[ @@ -2206,7 +2316,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 aa^ | {0:~ }| @@ -2215,11 +2325,13 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + {3:-- INSERT --} | + ## grid 4 {13:aa }| {1:word }| {1:longtext }| ]], float_pos={ - [3] = {{id = -1}, "NW", 2, 1, 0, false}, + [4] = {{id = -1}, "NW", 2, 1, 0, false}, }} else screen:expect([[ @@ -2243,7 +2355,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 aa^ | {0:~ }| @@ -2251,6 +2363,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| + ## grid 3 + {3:-- INSERT --} | ]]) else screen:expect([[ @@ -2278,7 +2392,7 @@ describe('floating windows', function() win = meths.open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) meths.buf_set_lines(buf,0,-1,true,{"y"}) expected_pos = { - [3]={{id=1001}, 'NW', 1, 2, 5, true} + [4]={{id=1001}, 'NW', 1, 2, 5, true} } if multigrid then screen:expect{grid=[[ @@ -2289,7 +2403,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| @@ -2298,6 +2412,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| ]], float_pos=expected_pos} @@ -2325,7 +2441,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -2334,6 +2450,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| ]], float_pos=expected_pos} @@ -2359,7 +2477,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| @@ -2368,6 +2486,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| ]], float_pos=expected_pos} @@ -2386,7 +2506,7 @@ describe('floating windows', function() it("w with focusable=false", function() meths.win_set_config(win, {focusable=false}) - expected_pos[3][6] = false + expected_pos[4][6] = false feed("<c-w>wi") -- i to provoke redraw if multigrid then screen:expect{grid=[[ @@ -2397,7 +2517,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| @@ -2406,6 +2526,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + {3:-- INSERT --} | + ## grid 4 {1:y }| {2:~ }| ]], float_pos=expected_pos} @@ -2431,7 +2553,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| @@ -2440,6 +2562,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| ]], float_pos=expected_pos} @@ -2467,7 +2591,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -2476,6 +2600,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| ]], float_pos=expected_pos} @@ -2501,7 +2627,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| @@ -2510,6 +2636,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| ]], float_pos=expected_pos} @@ -2528,7 +2656,7 @@ describe('floating windows', function() it("focus by mouse", function() if multigrid then - meths.input_mouse('left', 'press', '', 3, 0, 0) + meths.input_mouse('left', 'press', '', 4, 0, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]| @@ -2537,7 +2665,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -2546,6 +2674,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| ]], float_pos=expected_pos} @@ -2572,7 +2702,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| @@ -2581,6 +2711,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| ]], float_pos=expected_pos} @@ -2601,9 +2733,9 @@ describe('floating windows', function() it("focus by mouse (focusable=false)", function() meths.win_set_config(win, {focusable=false}) meths.buf_set_lines(0, -1, -1, true, {"a"}) - expected_pos[3][6] = false + expected_pos[4][6] = false if multigrid then - meths.input_mouse('left', 'press', '', 3, 0, 0) + meths.input_mouse('left', 'press', '', 4, 0, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]| @@ -2612,7 +2744,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^x | a | @@ -2621,6 +2753,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| ]], float_pos=expected_pos} @@ -2647,7 +2781,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^x | a | @@ -2656,6 +2790,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| ]], float_pos=expected_pos, unchanged=true} @@ -2685,7 +2821,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| @@ -2694,6 +2830,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + {3:-- INSERT --} | + ## grid 4 {1:y }| {2:~ }| ]], float_pos=expected_pos} @@ -2719,7 +2857,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -2728,6 +2866,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| ]], float_pos=expected_pos} @@ -2753,7 +2893,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| @@ -2762,6 +2902,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| ]], float_pos=expected_pos} @@ -2790,7 +2932,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -2799,6 +2941,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| ]], float_pos=expected_pos} @@ -2824,7 +2968,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -2833,6 +2977,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| {2:~ }| @@ -2859,7 +3005,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -2868,6 +3014,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| ]], float_pos=expected_pos} else @@ -2892,7 +3040,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -2901,6 +3049,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| {2:~ }| @@ -2928,7 +3078,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -2937,6 +3087,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| {2:~ }| @@ -2968,7 +3120,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -2977,6 +3129,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| ]], float_pos=expected_pos} @@ -3002,7 +3156,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -3011,6 +3165,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| ]], float_pos=expected_pos} @@ -3036,7 +3192,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -3045,6 +3201,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| ]], float_pos=expected_pos} @@ -3070,7 +3228,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -3079,6 +3237,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| ]], float_pos=expected_pos} @@ -3104,7 +3264,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -3113,6 +3273,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| ]], float_pos=expected_pos} @@ -3134,20 +3296,22 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:----------------------------------------]| - [4:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| {4:[No Name] [+] }| [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 ^x | {0:~ }| ]], float_pos=expected_pos} @@ -3167,20 +3331,22 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:----------------------------------------]| - [4:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| {5:[No Name] [+] }| [2:----------------------------------------]| [2:----------------------------------------]| {4:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 x | {0:~ }| ]], float_pos=expected_pos} @@ -3200,20 +3366,22 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:----------------------------------------]| - [4:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| {5:[No Name] [+] }| [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| - ## grid 4 + ## grid 5 x | {0:~ }| ]], float_pos=expected_pos} @@ -3234,20 +3402,22 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:----------------------------------------]| - [4:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| {4:[No Name] [+] }| [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 ^x | {0:~ }| ]], float_pos=expected_pos} @@ -3269,20 +3439,22 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:----------------------------------------]| - [4:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| {4:[No Name] [+] }| [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 ^y | {0:~ }| ]], float_pos=expected_pos} @@ -3302,20 +3474,22 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:----------------------------------------]| - [4:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| {5:[No Name] [+] }| [2:----------------------------------------]| [2:----------------------------------------]| {4:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 y | {0:~ }| ]], float_pos=expected_pos} @@ -3335,20 +3509,22 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:----------------------------------------]| - [4:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| {5:[No Name] [+] }| [2:----------------------------------------]| [2:----------------------------------------]| {4:[No Name] [+] }| - {3:-- INSERT --} | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| ## grid 3 + {3:-- INSERT --} | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 y | {0:~ }| ]], float_pos=expected_pos} @@ -3370,20 +3546,22 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:----------------------------------------]| - [4:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| {4:[No Name] }| [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - :new | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| ## grid 3 + :new | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 ^ | {0:~ }| ]], float_pos=expected_pos} @@ -3405,20 +3583,22 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:----------------------------------------]| - [4:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| {4:[No Name] }| [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - :new | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| ## grid 3 + :new | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 ^ | {0:~ }| ]], float_pos=expected_pos} @@ -3440,13 +3620,13 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:--------------------]{5:│}[2:-------------------]| - [4:--------------------]{5:│}[2:-------------------]| - [4:--------------------]{5:│}[2:-------------------]| - [4:--------------------]{5:│}[2:-------------------]| - [4:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| {4:[No Name] [+] }{5:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -3454,9 +3634,11 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 ^x | {0:~ }| {0:~ }| @@ -3481,13 +3663,13 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:--------------------]{5:│}[2:-------------------]| - [4:--------------------]{5:│}[2:-------------------]| - [4:--------------------]{5:│}[2:-------------------]| - [4:--------------------]{5:│}[2:-------------------]| - [4:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| {4:[No Name] }{5:[No Name] [+] }| - :vnew | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -3495,9 +3677,11 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + :vnew | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 ^ | {0:~ }| {0:~ }| @@ -3522,13 +3706,13 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:--------------------]{5:│}[2:-------------------]| - [4:--------------------]{5:│}[2:-------------------]| - [4:--------------------]{5:│}[2:-------------------]| - [4:--------------------]{5:│}[2:-------------------]| - [4:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]| {4:[No Name] }{5:[No Name] [+] }| - :vnew | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -3536,9 +3720,11 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + :vnew | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 ^ | {0:~ }| {0:~ }| @@ -3594,7 +3780,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -3603,14 +3789,16 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 {1:^y }| {2:~ }| ]], float_pos={ - [3] = {{id = 1001}, "NW", 1, 2, 5, true}, - [4] = {{id = 1002}, "NW", 1, 4, 8, true} + [4] = {{id = 1001}, "NW", 1, 2, 5, true}, + [5] = {{id = 1002}, "NW", 1, 4, 8, true} }} else screen:expect([[ @@ -3634,7 +3822,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - :quit | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -3642,10 +3830,12 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + :quit | + ## grid 4 {1:^y }| {2:~ }| ]], float_pos={ - [3] = {{id = 1001}, "NW", 1, 2, 5, true}, + [4] = {{id = 1001}, "NW", 1, 2, 5, true}, }} else screen:expect([[ @@ -3669,7 +3859,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - :quit | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| @@ -3677,6 +3867,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| + ## grid 3 + :quit | ]]) else screen:expect([[ @@ -3704,7 +3896,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| @@ -3712,6 +3904,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| + ## grid 3 + | ]]} else screen:expect([[ @@ -3734,10 +3928,10 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - {4: }| - {7:E5601: Cannot close window, only floatin}| - {7:g window would remain} | - {8:Press ENTER or type command to continue}^ | + [2:----------------------------------------]| + [3:----------------------------------------]| + [3:----------------------------------------]| + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -3746,6 +3940,10 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + {7:E5601: Cannot close window, only floatin}| + {7:g window would remain} | + {8:Press ENTER or type command to continue}^ | + ## grid 4 {1:y }| {2:~ }| ]], float_pos=expected_pos} @@ -3772,7 +3970,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -3781,6 +3979,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| ]], float_pos=expected_pos} @@ -3802,20 +4002,22 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:----------------------------------------]| - [4:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| {4:[No Name] [+] }| [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 ^x | {0:~ }| ]], float_pos=expected_pos} @@ -3835,14 +4037,16 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [3:----------------------------------------]| + ## grid 3 | - ## grid 4 + ## grid 5 ^x | {0:~ }| {0:~ }| @@ -3868,20 +4072,22 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:----------------------------------------]| - [4:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| {5:[No Name] [+] }| [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| ## grid 3 + | + ## grid 4 {1:^y }| {2:~ }| - ## grid 4 + ## grid 5 x | {0:~ }| ]], float_pos=expected_pos} @@ -3901,20 +4107,24 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [4:----------------------------------------]| - [4:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| {5:[No Name] [+] }| - {4: }| - {7:E5601: Cannot close window, only floatin}| - {7:g window would remain} | - {8:Press ENTER or type command to continue}^ | + [2:----------------------------------------]| + [3:----------------------------------------]| + [3:----------------------------------------]| + [3:----------------------------------------]| ## grid 2 x | {0:~ }| ## grid 3 + {7:E5601: Cannot close window, only floatin}| + {7:g window would remain} | + {8:Press ENTER or type command to continue}^ | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 x | {0:~ }| ]], float_pos=expected_pos} @@ -3939,14 +4149,16 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - [3:----------------------------------------]| - [3:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| {4:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| ## grid 3 + | + ## grid 4 ^y | {0:~ }| ]]} @@ -3964,7 +4176,7 @@ describe('floating windows', function() if multigrid then meths.win_set_config(0, {external=true, width=30, height=2}) - expected_pos = {[3]={external=true}} + expected_pos = {[4]={external=true}} screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]| @@ -3973,7 +4185,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| @@ -3981,6 +4193,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 ^y | {0:~ }| ]], float_pos=expected_pos} @@ -3997,14 +4211,16 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| {5:[No Name] [+] }| - [3:----------------------------------------]| - [3:----------------------------------------]| + [4:----------------------------------------]| + [4:----------------------------------------]| {4:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| ## grid 3 + | + ## grid 4 ^y | {0:~ }| ]]) @@ -4017,26 +4233,28 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:--------------------]{5:│}[4:-------------------]| - [5:--------------------]{5:│}[4:-------------------]| + [6:--------------------]{5:│}[5:-------------------]| + [6:--------------------]{5:│}[5:-------------------]| {5:[No Name] [+] [No Name] [+] }| - [6:--------------------]{5:│}[2:-------------------]| - [6:--------------------]{5:│}[2:-------------------]| + [7:--------------------]{5:│}[2:-------------------]| + [7:--------------------]{5:│}[2:-------------------]| {4:[No Name] [+] }{5:[No Name] [+] }| - | + [3:----------------------------------------]| ## grid 2 x | {0:~ }| ## grid 3 + | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 + ## grid 5 x | {0:~ }| - ## grid 5 + ## grid 6 x | {0:~ }| - ## grid 6 + ## grid 7 ^x | {0:~ }| ]], float_pos=expected_pos} @@ -4062,26 +4280,28 @@ describe('floating windows', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:-------------------]{5:│}[4:--------------------]| - [5:-------------------]{5:│}[4:--------------------]| + [6:-------------------]{5:│}[5:--------------------]| + [6:-------------------]{5:│}[5:--------------------]| {5:[No Name] [+] [No Name] [+] }| - [6:-------------------]{5:│}[2:--------------------]| - [6:-------------------]{5:│}[2:--------------------]| + [7:-------------------]{5:│}[2:--------------------]| + [7:-------------------]{5:│}[2:--------------------]| {5:[No Name] [+] [No Name] [+] }| - :enew | + [3:----------------------------------------]| ## grid 2 4 | {0:~ }| ## grid 3 + :enew | + ## grid 4 {1:^5 }| {2:~ }| - ## grid 4 + ## grid 5 2 | {0:~ }| - ## grid 5 + ## grid 6 1 | {0:~ }| - ## grid 6 + ## grid 7 3 | {0:~ }| ]], float_pos=expected_pos} @@ -4138,12 +4358,12 @@ describe('floating windows', function() screen:expect{grid=[[ ## grid 1 {9: }{10:2}{9:+ [No Name] }{3: [No Name] }{5: }{9:X}| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - :tabnew | + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [3:----------------------------------------]| ## grid 2 (hidden) x | {0:~ }| @@ -4151,10 +4371,12 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| - ## grid 3 (hidden) + ## grid 3 + :tabnew | + ## grid 4 (hidden) {1:y }| {2:~ }| - ## grid 4 + ## grid 5 ^ | {0:~ }| {0:~ }| @@ -4183,7 +4405,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - :tabnext | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| @@ -4191,9 +4413,11 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + :tabnext | + ## grid 4 {1:y }| {2:~ }| - ## grid 4 (hidden) + ## grid 5 (hidden) | {0:~ }| {0:~ }| @@ -4217,22 +4441,24 @@ describe('floating windows', function() screen:expect{grid=[[ ## grid 1 {9: }{10:2}{9:+ [No Name] }{3: [No Name] }{5: }{9:X}| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - :tabnext | + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [3:----------------------------------------]| ## grid 2 (hidden) x | {0:~ }| {0:~ }| {0:~ }| {0:~ }| - ## grid 3 (hidden) + ## grid 3 + :tabnext | + ## grid 4 (hidden) {1:y }| {2:~ }| - ## grid 4 + ## grid 5 ^ | {0:~ }| {0:~ }| @@ -4256,17 +4482,17 @@ describe('floating windows', function() if multigrid then -- also test external window wider than main screen meths.win_set_config(win, {external=true, width=65, height=4}) - expected_pos = {[3]={external=true}} + expected_pos = {[4]={external=true}} feed(":tabnew<cr>") screen:expect{grid=[[ ## grid 1 {9: + [No Name] }{3: }{11:2}{3:+ [No Name] }{5: }{9:X}| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - :tabnew | + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [3:----------------------------------------]| ## grid 2 (hidden) x | {0:~ }| @@ -4275,11 +4501,13 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + :tabnew | + ## grid 4 y | {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 5 ^ | {0:~ }| {0:~ }| @@ -4301,7 +4529,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - :tabnext | + [3:----------------------------------------]| ## grid 2 ^x | {0:~ }| @@ -4309,11 +4537,13 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + :tabnext | + ## grid 4 y | {0:~ }| {0:~ }| {0:~ }| - ## grid 4 (hidden) + ## grid 5 (hidden) | {0:~ }| {0:~ }| @@ -4327,12 +4557,12 @@ describe('floating windows', function() screen:expect{grid=[[ ## grid 1 {9: + [No Name] }{3: }{11:2}{3:+ [No Name] }{5: }{9:X}| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - :tabnext | + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [5:----------------------------------------]| + [3:----------------------------------------]| ## grid 2 (hidden) x | {0:~ }| @@ -4340,11 +4570,13 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + :tabnext | + ## grid 4 y | {0:~ }| {0:~ }| {0:~ }| - ## grid 4 + ## grid 5 ^ | {0:~ }| {0:~ }| @@ -4397,7 +4629,7 @@ describe('floating windows', function() [2:--------------------------------------------------]| [2:--------------------------------------------------]| [2:--------------------------------------------------]| - | + [3:--------------------------------------------------]| ## grid 2 Ut enim ad minim veniam, quis nostrud | exercitation ullamco laboris nisi ut aliquip ex | @@ -4407,11 +4639,13 @@ describe('floating windows', function() occaecat cupidatat non proident, sunt in culpa | qui officia deserunt mollit anim id est | laborum^. | - ## grid 4 + ## grid 3 + | + ## grid 5 {1:test }| {1: }| {1:popup text }| - ]], float_pos={[4] = {{id = 1002}, "NW", 1, 2, 5, true}}} + ]], float_pos={[5] = {{id = 1002}, "NW", 1, 2, 5, true}}} else screen:expect([[ Ut enim ad minim veniam, quis nostrud | @@ -4438,7 +4672,7 @@ describe('floating windows', function() [2:--------------------------------------------------]| [2:--------------------------------------------------]| [2:--------------------------------------------------]| - | + [3:--------------------------------------------------]| ## grid 2 Ut enim ad minim veniam, quis nostrud | exercitation ullamco laboris nisi ut aliquip ex | @@ -4448,11 +4682,13 @@ describe('floating windows', function() occaecat cupidatat non proident, sunt in culpa | qui officia deserunt mollit anim id est | laborum^. | - ## grid 4 + ## grid 3 + | + ## grid 5 {9:test }| {9: }| {9:popup text }| - ]], float_pos={[4] = {{id = 1002}, "NW", 1, 2, 5, true}}, unchanged=true} + ]], float_pos={[5] = {{id = 1002}, "NW", 1, 2, 5, true}}, unchanged=true} else screen:expect([[ Ut enim ad minim veniam, quis nostrud | @@ -4480,7 +4716,7 @@ describe('floating windows', function() [2:--------------------------------------------------]| [2:--------------------------------------------------]| [2:--------------------------------------------------]| - | + [3:--------------------------------------------------]| ## grid 2 Ut enim ad minim veniam, quis nostrud | exercitation ullamco laboris nisi ut aliquip ex | @@ -4490,11 +4726,13 @@ describe('floating windows', function() occaecat cupidatat non proident, sunt in culpa | qui officia deserunt mollit anim id est | laborum^. | - ## grid 4 + ## grid 3 + | + ## grid 5 {9:test }| {9: }| {10:popup text}{9: }| - ]], float_pos={[4] = {{id = 1002}, "NW", 1, 2, 5, true}}} + ]], float_pos={[5] = {{id = 1002}, "NW", 1, 2, 5, true}}} else screen:expect([[ Ut enim ad minim veniam, quis nostrud | @@ -4521,7 +4759,7 @@ describe('floating windows', function() [2:--------------------------------------------------]| [2:--------------------------------------------------]| [2:--------------------------------------------------]| - | + [3:--------------------------------------------------]| ## grid 2 Ut enim ad minim veniam, quis nostrud | exercitation ullamco laboris nisi ut aliquip ex | @@ -4531,11 +4769,13 @@ describe('floating windows', function() occaecat cupidatat non proident, sunt in culpa | qui officia deserunt mollit anim id est | laborum^. | - ## grid 4 + ## grid 3 + | + ## grid 5 {9:test }| {9: }| {11:popup text}{9: }| - ]], float_pos={[4] = {{id = 1002}, "NW", 1, 2, 5, true}}, unchanged=true} + ]], float_pos={[5] = {{id = 1002}, "NW", 1, 2, 5, true}}, unchanged=true} else screen:expect([[ Ut enim ad minim veniam, quis nostrud | @@ -4552,7 +4792,7 @@ describe('floating windows', function() -- Test scrolling by mouse if multigrid then - meths.input_mouse('wheel', 'down', '', 4, 2, 2) + meths.input_mouse('wheel', 'down', '', 5, 2, 2) screen:expect{grid=[[ ## grid 1 [2:--------------------------------------------------]| @@ -4563,7 +4803,7 @@ describe('floating windows', function() [2:--------------------------------------------------]| [2:--------------------------------------------------]| [2:--------------------------------------------------]| - | + [3:--------------------------------------------------]| ## grid 2 Ut enim ad minim veniam, quis nostrud | exercitation ullamco laboris nisi ut aliquip ex | @@ -4573,11 +4813,13 @@ describe('floating windows', function() occaecat cupidatat non proident, sunt in culpa | qui officia deserunt mollit anim id est | laborum^. | - ## grid 4 + ## grid 3 + | + ## grid 5 {11:popup text}{9: }| {12:~ }| {12:~ }| - ]], float_pos={[4] = {{id = 1002}, "NW", 1, 2, 5, true}}} + ]], float_pos={[5] = {{id = 1002}, "NW", 1, 2, 5, true}}} else meths.input_mouse('wheel', 'down', '', 0, 4, 7) screen:expect([[ @@ -4609,7 +4851,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 # TODO: 测试字典信息的准确性 | # FIXME: 测试字典信息的准确^性 | @@ -4618,10 +4860,12 @@ describe('floating windows', function() {0:~ }| {0:~ }| ## grid 3 + | + ## grid 4 {1: }| {1: }| {1: }| - ]], float_pos={ [3] = { { id = 1001 }, "NW", 1, 0, 11, true } }} + ]], float_pos={ [4] = { { id = 1001 }, "NW", 1, 0, 11, true } }} else screen:expect([[ # TODO: 测 {1: }信息的准确性 | @@ -4644,7 +4888,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 # TODO: 测试字典信息的准确性 | # FIXME: 测试字典信息的准确^性 | @@ -4652,6 +4896,8 @@ describe('floating windows', function() {0:~ }| {0:~ }| {0:~ }| + ## grid 3 + | ]]) else screen:expect([[ @@ -4687,7 +4933,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 # TODO: 测试字典信息的准确性 | # FIXME: 测试字典信息的准确^性 | @@ -4695,12 +4941,14 @@ describe('floating windows', function() {3:~ }| {3:~ }| {3:~ }| - ## grid 5 + ## grid 3 + | + ## grid 6 {5: x x x xx}| {5: x x x x}| {5: }| ]], float_pos={ - [5] = { { + [6] = { { id = 1003 }, "NW", 1, 0, 11, true } }} @@ -4726,7 +4974,7 @@ describe('floating windows', function() [2:----------------------------------------]| [2:----------------------------------------]| [2:----------------------------------------]| - | + [3:----------------------------------------]| ## grid 2 # TODO: 测试字典信息的准确性 | # FIXME: 测试字典信息的准确^性 | @@ -4734,12 +4982,14 @@ describe('floating windows', function() {3:~ }| {3:~ }| {3:~ }| - ## grid 5 + ## grid 3 + | + ## grid 6 {5: x x x xx}| {5: x x x x}| {5: }| ]], float_pos={ - [5] = { { + [6] = { { id = 1003 }, "NW", 1, 0, 12, true } }} diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index 08566fe493..47b2d23c9b 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -933,17 +933,29 @@ end) describe("MsgSeparator highlight and msgsep fillchar", function() - before_each(clear) - it("works", function() - local screen = Screen.new(50,5) + local screen + before_each(function() + clear() + screen = Screen.new(50,5) screen:set_default_attr_ids({ [1] = {bold=true, foreground=Screen.colors.Blue}, [2] = {bold=true, reverse=true}, [3] = {bold = true, foreground = Screen.colors.SeaGreen4}, [4] = {background = Screen.colors.Cyan, bold = true, reverse = true}, - [5] = {bold = true, background = Screen.colors.Magenta} + [5] = {bold = true, background = Screen.colors.Magenta}, + [6] = {background = Screen.colors.WebGray}, + [7] = {background = Screen.colors.WebGray, bold = true, foreground = Screen.colors.SeaGreen4}, + [8] = {foreground = Screen.colors.Grey0, background = Screen.colors.Gray60}, + [9] = {foreground = Screen.colors.Grey40, background = Screen.colors.Gray60}, + [10] = {foreground = tonumber('0x000019'), background = Screen.colors.Gray60}, + [11] = {background = Screen.colors.Gray60, bold = true, foreground = tonumber('0x666699')}, + [12] = {background = Screen.colors.Gray60, bold = true, foreground = tonumber('0x297d4e')}, + [13] = {background = tonumber('0xff4cff'), bold = true, foreground = tonumber('0xb200ff')}, }) screen:attach() + end) + + it("works", function() -- defaults feed_command("ls") @@ -1000,6 +1012,61 @@ describe("MsgSeparator highlight and msgsep fillchar", function() {3:Press ENTER or type command to continue}^ | ]]) end) + + it("and MsgArea", function() + feed_command("hi MsgArea guibg=Gray") + screen:expect{grid=[[ + ^ | + {1:~ }| + {1:~ }| + {1:~ }| + {6: }| + ]]} + feed(":ls") + screen:expect{grid=[[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {6::ls^ }| + ]]} + feed(":<cr>") + screen:expect{grid=[[ + | + {2: }| + {6::ls: }| + {6: 1 %a "[No Name]" line 1 }| + {7:Press ENTER or type command to continue}{6:^ }| + ]]} + + -- support madness^Wblending of message "overlay" + feed_command("hi MsgArea blend=20") + feed_command("hi clear MsgSeparator") + feed_command("hi MsgSeparator blend=30 guibg=Magenta") + screen:expect{grid=[[ + ^ | + {1:~ }| + {1:~ }| + {1:~ }| + {8::hi}{9: }{8:MsgSeparator}{9: }{8:blend=30}{9: }{8:guibg=Magenta}{9: }| + ]]} + feed(":ls") + screen:expect{grid=[[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {8::ls}{9:^ }| + ]]} + feed("<cr>") + screen:expect{grid=[[ + | + {13:~ }| + {10::ls}{11: }| + {11:~ }{10:1}{11: }{10:%a}{11: }{10:"[No}{11: }{10:Name]"}{11: }{10:line}{11: }{10:1}{11: }| + {12:Press}{9: }{12:ENTER}{9: }{12:or}{9: }{12:type}{9: }{12:command}{9: }{12:to}{9: }{12:continue}{9:^ }| + ]]} + end) end) describe("'winhighlight' highlight", function() diff --git a/test/functional/ui/hlstate_spec.lua b/test/functional/ui/hlstate_spec.lua index 775b701438..d1c115587e 100644 --- a/test/functional/ui/hlstate_spec.lua +++ b/test/functional/ui/hlstate_spec.lua @@ -39,7 +39,7 @@ describe('ext_hlstate detailed highlights', function() {5:~ }| {5:~ }| {5:~ }| - {6:search hit BOTTOM, continuing at TOP} | + {8:search hit BOTTOM, continuing at TOP}{7: }| ]], { [1] = {{foreground = Screen.colors.Magenta}, {{hi_name = "Constant", kind = "syntax"}}}, @@ -52,6 +52,8 @@ describe('ext_hlstate detailed highlights', function() {{hi_name = "NonText", ui_name = "EndOfBuffer", kind = "ui"}}}, [6] = {{foreground = Screen.colors.Red}, {{hi_name = "WarningMsg", ui_name = "WarningMsg", kind = "ui"}}}, + [7] = {{}, {{hi_name = "MsgArea", ui_name = "MsgArea", kind = "ui"}}}, + [8] = {{foreground = Screen.colors.Red}, {7, 6}}, }) end) @@ -66,6 +68,7 @@ describe('ext_hlstate detailed highlights', function() {{hi_name = "StatusLineNC", ui_name = "StatusLineNC" , kind = "ui"}}}, [5] = {{}, {{hi_name = "StatusLine", ui_name = "StatusLine", kind = "ui"}}}, [6] = {{}, {{hi_name = "StatusLineNC", ui_name = "StatusLineNC", kind = "ui"}}}, + [7] = {{}, {{hi_name = "MsgArea", ui_name = "MsgArea", kind = "ui"}}}, }) command("hi clear VertSplit") command("vsplit") @@ -78,7 +81,7 @@ describe('ext_hlstate detailed highlights', function() {2:~ }{1:│}{2:~ }| {2:~ }{1:│}{2:~ }| {3:[No Name] }{4:[No Name] }| - | + {7: }| ]]) command("hi clear StatusLine | hi clear StatuslineNC") @@ -90,7 +93,7 @@ describe('ext_hlstate detailed highlights', function() {2:~ }{1:│}{2:~ }| {2:~ }{1:│}{2:~ }| {5:[No Name] }{6:[No Name] }| - | + {7: }| ]]) -- redrawing is done even if visible highlights didn't change @@ -103,7 +106,7 @@ describe('ext_hlstate detailed highlights', function() {2:~ }{1:│}{2:~ }| {2:~ }{1:│}{2:~ }| {6:[No Name] }{5:[No Name] }| - | + {7: }| ]]) end) @@ -120,7 +123,8 @@ describe('ext_hlstate detailed highlights', function() [8] = {{foreground = Screen.colors.Blue1, bold = true, reverse = true}, {6, 2}}, [9] = {{bold = true, foreground = Screen.colors.Brown}, {{hi_name = "Statement", ui_name = "NormalNC", kind = "ui"}}}, [10] = {{bold = true, foreground = Screen.colors.Brown}, {9, 1}}, - [11] = {{bold = true, foreground = Screen.colors.Blue1}, {9, 2}} + [11] = {{bold = true, foreground = Screen.colors.Blue1}, {9, 2}}, + [12] = {{}, {{hi_name = "MsgArea", ui_name = "MsgArea", kind = "ui"}}}, }) command("set number") @@ -134,7 +138,7 @@ describe('ext_hlstate detailed highlights', function() {1: 1 } | {2:~ }| {4:[No Name] }| - | + {12: }| ]]) command("set winhl=LineNr:ErrorMsg") @@ -146,7 +150,7 @@ describe('ext_hlstate detailed highlights', function() {1: 1 } | {2:~ }| {4:[No Name] }| - | + {12: }| ]]) command("set winhl=Normal:MsgSeparator,NormalNC:Statement") @@ -158,7 +162,7 @@ describe('ext_hlstate detailed highlights', function() {1: 1 } | {2:~ }| {4:[No Name] }| - | + {12: }| ]]) command("wincmd w") @@ -170,7 +174,7 @@ describe('ext_hlstate detailed highlights', function() {1: 1 }^ | {2:~ }| {3:[No Name] }| - | + {12: }| ]]) end) @@ -182,6 +186,7 @@ describe('ext_hlstate detailed highlights', function() [4] = {{foreground = 52479}, {2, 1}}, [5] = {{foreground = 4259839}, {{kind = "term"}}}, [6] = {{foreground = 4259839}, {5, 1}}, + [7] = {{}, {{hi_name = "MsgArea", ui_name = "MsgArea", kind = "ui"}}}, }) command('enew | call termopen(["'..nvim_dir..'/tty-test"])') screen:expect([[ @@ -192,7 +197,7 @@ describe('ext_hlstate detailed highlights', function() | | | - | + {7: }| ]]) thelpers.feed_data('x ') @@ -210,7 +215,7 @@ describe('ext_hlstate detailed highlights', function() | | | - | + {7: }| ]]) else screen:expect([[ @@ -221,7 +226,7 @@ describe('ext_hlstate detailed highlights', function() | | | - | + {7: }| ]]) end @@ -236,7 +241,7 @@ describe('ext_hlstate detailed highlights', function() | | | - | + {7: }| ]]) else screen:expect([[ @@ -247,7 +252,7 @@ describe('ext_hlstate detailed highlights', function() | | | - | + {7: }| ]]) end end) @@ -259,6 +264,7 @@ describe('ext_hlstate detailed highlights', function() screen:set_default_attr_ids({ [1] = {{bold = true, foreground = Screen.colors.Blue1}, {foreground = 12}, {{hi_name = "NonText", ui_name = "EndOfBuffer", kind = "ui"}}}, [2] = {{reverse = true, foreground = Screen.colors.Red}, {foreground = 10, italic=true}, {{hi_name = "NonText", ui_name = "EndOfBuffer", kind = "ui"}}}, + [3] = {{}, {}, {{hi_name = "MsgArea", ui_name = "MsgArea", kind = "ui"}}}, }) screen:expect([[ ^ | @@ -268,7 +274,7 @@ describe('ext_hlstate detailed highlights', function() {1:~ }| {1:~ }| {1:~ }| - | + {3: }| ]]) command("hi NonText guifg=Red gui=reverse ctermfg=Green cterm=italic") @@ -280,7 +286,7 @@ describe('ext_hlstate detailed highlights', function() {2:~ }| {2:~ }| {2:~ }| - | + {3: }| ]]) end) diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua index a910f5e2ea..30a5b63d89 100644 --- a/test/functional/ui/multigrid_spec.lua +++ b/test/functional/ui/multigrid_spec.lua @@ -42,7 +42,7 @@ describe('ext_multigrid', function() end) it('default initial screen', function() - screen:expect([[ + screen:expect{grid=[[ ## grid 1 [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -57,7 +57,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {11:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 ^ | {1:~ }| @@ -71,27 +71,29 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ## grid 3 + | + ]]} end) it('positions windows correctly', function() command('vsplit') screen:expect{grid=[[ ## grid 1 - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| {11:[No Name] }{12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -106,6 +108,8 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 ^ | {1:~ }| {1:~ }| @@ -121,27 +125,27 @@ describe('ext_multigrid', function() ]], condition=function() eq({ [2] = { win = {id=1000}, startrow = 0, startcol = 27, width = 26, height = 12 }, - [3] = { win = {id=1001}, startrow = 0, startcol = 0, width = 26, height = 12 } + [4] = { win = {id=1001}, startrow = 0, startcol = 0, width = 26, height = 12 } }, screen.win_position) end} command('wincmd l') command('split') screen:expect{grid=[[ ## grid 1 - [3:--------------------------]{12:│}[4:--------------------------]| - [3:--------------------------]{12:│}[4:--------------------------]| - [3:--------------------------]{12:│}[4:--------------------------]| - [3:--------------------------]{12:│}[4:--------------------------]| - [3:--------------------------]{12:│}[4:--------------------------]| - [3:--------------------------]{12:│}[4:--------------------------]| - [3:--------------------------]{12:│}{11:[No Name] }| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[5:--------------------------]| + [4:--------------------------]{12:│}[5:--------------------------]| + [4:--------------------------]{12:│}[5:--------------------------]| + [4:--------------------------]{12:│}[5:--------------------------]| + [4:--------------------------]{12:│}[5:--------------------------]| + [4:--------------------------]{12:│}[5:--------------------------]| + [4:--------------------------]{12:│}{11:[No Name] }| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| {12:[No Name] [No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -149,6 +153,8 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 | {1:~ }| {1:~ }| @@ -161,7 +167,7 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 5 ^ | {1:~ }| {1:~ }| @@ -171,20 +177,20 @@ describe('ext_multigrid', function() ]], condition=function() eq({ [2] = { win = {id=1000}, startrow = 7, startcol = 27, width = 26, height = 5 }, - [3] = { win = {id=1001}, startrow = 0, startcol = 0, width = 26, height = 12 }, - [4] = { win = {id=1002}, startrow = 0, startcol = 27, width = 26, height = 6 } + [4] = { win = {id=1001}, startrow = 0, startcol = 0, width = 26, height = 12 }, + [5] = { win = {id=1002}, startrow = 0, startcol = 27, width = 26, height = 6 } }, screen.win_position) end} command('wincmd h') command('q') screen:expect{grid=[[ ## grid 1 - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| {11:[No Name] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -192,14 +198,16 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 3 + | + ## grid 5 ^ | {1:~ }| {1:~ }| @@ -209,7 +217,7 @@ describe('ext_multigrid', function() ]], condition=function() eq({ [2] = { win = {id=1000}, startrow = 7, startcol = 0, width = 53, height = 5 }, - [4] = { win = {id=1002}, startrow = 0, startcol = 0, width = 53, height = 6 } + [5] = { win = {id=1002}, startrow = 0, startcol = 0, width = 53, height = 6 } }, screen.win_position) end} end) @@ -220,12 +228,12 @@ describe('ext_multigrid', function() command('sp') screen:expect([[ ## grid 1 - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| {11:[No Name] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -233,7 +241,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -241,6 +249,8 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 ^ | {1:~ }| {1:~ }| @@ -255,25 +265,27 @@ describe('ext_multigrid', function() command('resize 8') screen:expect([[ ## grid 1 - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| {11:[No Name] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 ^ | {1:~ }| {1:~ }| @@ -289,14 +301,14 @@ describe('ext_multigrid', function() command('sp') command('vsp') command('vsp') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]| - [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]| - [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]| - [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]| - [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]| - [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]| + [6:--------------------]{12:│}[5:----------------]{12:│}[4:---------------]| + [6:--------------------]{12:│}[5:----------------]{12:│}[4:---------------]| + [6:--------------------]{12:│}[5:----------------]{12:│}[4:---------------]| + [6:--------------------]{12:│}[5:----------------]{12:│}[4:---------------]| + [6:--------------------]{12:│}[5:----------------]{12:│}[4:---------------]| + [6:--------------------]{12:│}[5:----------------]{12:│}[4:---------------]| {11:[No Name] }{12:[No Name] [No Name] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -304,7 +316,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -312,36 +324,38 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 5 | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 5 + ## grid 6 ^ | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} insert('hello') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]| - [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]| - [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]| - [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]| - [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]| - [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]| + [6:--------------------]{12:│}[5:----------------]{12:│}[4:---------------]| + [6:--------------------]{12:│}[5:----------------]{12:│}[4:---------------]| + [6:--------------------]{12:│}[5:----------------]{12:│}[4:---------------]| + [6:--------------------]{12:│}[5:----------------]{12:│}[4:---------------]| + [6:--------------------]{12:│}[5:----------------]{12:│}[4:---------------]| + [6:--------------------]{12:│}[5:----------------]{12:│}[4:---------------]| {11:[No Name] [+] }{12:[No Name] [+] [No Name] [+] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -349,7 +363,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 hello | {1:~ }| @@ -357,38 +371,40 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 hello | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 5 hello | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 5 + ## grid 6 hell^o | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} end) it('closes splits', function () command('sp') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| {11:[No Name] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -396,7 +412,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -404,15 +420,17 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 ^ | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} command('q') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -427,7 +445,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {11:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 ^ | {1:~ }| @@ -441,29 +459,31 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ## grid 3 + | + ]]} end) end) describe('vertically', function () it('allocates grids', function () command('vsp') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| {11:[No Name] }{12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -478,6 +498,8 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 ^ | {1:~ }| {1:~ }| @@ -490,28 +512,27 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} end) it('resizes grids', function () command('vsp') command('vertical resize 10') - -- see "Note 1" for info about why there are two vseps - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [3:----------]{12:│}[2:------------------------------------------]| - [3:----------]{12:│}[2:------------------------------------------]| - [3:----------]{12:│}[2:------------------------------------------]| - [3:----------]{12:│}[2:------------------------------------------]| - [3:----------]{12:│}[2:------------------------------------------]| - [3:----------]{12:│}[2:------------------------------------------]| - [3:----------]{12:│}[2:------------------------------------------]| - [3:----------]{12:│}[2:------------------------------------------]| - [3:----------]{12:│}[2:------------------------------------------]| - [3:----------]{12:│}[2:------------------------------------------]| - [3:----------]{12:│}[2:------------------------------------------]| - [3:----------]{12:│}[2:------------------------------------------]| + [4:----------]{12:│}[2:------------------------------------------]| + [4:----------]{12:│}[2:------------------------------------------]| + [4:----------]{12:│}[2:------------------------------------------]| + [4:----------]{12:│}[2:------------------------------------------]| + [4:----------]{12:│}[2:------------------------------------------]| + [4:----------]{12:│}[2:------------------------------------------]| + [4:----------]{12:│}[2:------------------------------------------]| + [4:----------]{12:│}[2:------------------------------------------]| + [4:----------]{12:│}[2:------------------------------------------]| + [4:----------]{12:│}[2:------------------------------------------]| + [4:----------]{12:│}[2:------------------------------------------]| + [4:----------]{12:│}[2:------------------------------------------]| {11:<No Name] }{12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -526,6 +547,8 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 ^ | {1:~ }| {1:~ }| @@ -538,27 +561,27 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} end) it('splits horizontally', function () command('vsp') command('sp') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + {11:[No Name] }{12:│}[2:--------------------------]| [4:--------------------------]{12:│}[2:--------------------------]| [4:--------------------------]{12:│}[2:--------------------------]| [4:--------------------------]{12:│}[2:--------------------------]| [4:--------------------------]{12:│}[2:--------------------------]| [4:--------------------------]{12:│}[2:--------------------------]| - [4:--------------------------]{12:│}[2:--------------------------]| - {11:[No Name] }{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| {12:[No Name] [No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -573,36 +596,38 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 | {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 5 ^ | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} insert('hello') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + {11:[No Name] [+] }{12:│}[2:--------------------------]| [4:--------------------------]{12:│}[2:--------------------------]| [4:--------------------------]{12:│}[2:--------------------------]| [4:--------------------------]{12:│}[2:--------------------------]| [4:--------------------------]{12:│}[2:--------------------------]| [4:--------------------------]{12:│}[2:--------------------------]| - [4:--------------------------]{12:│}[2:--------------------------]| - {11:[No Name] [+] }{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| {12:[No Name] [+] [No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 hello | {1:~ }| @@ -617,38 +642,40 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 hello | {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 5 hell^o | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} end) it('closes splits', function () command('vsp') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| {11:[No Name] }{12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -663,6 +690,8 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 ^ | {1:~ }| {1:~ }| @@ -675,9 +704,9 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} command('q') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -692,7 +721,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {11:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 ^ | {1:~ }| @@ -706,7 +735,9 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ## grid 3 + | + ]]} end) end) end) @@ -714,49 +745,56 @@ describe('ext_multigrid', function() describe('on resize', function () it('rebuilds all grids', function () screen:try_resize(25, 6) - screen:expect([[ + screen:expect{grid=[[ ## grid 1 [2:-------------------------]| [2:-------------------------]| [2:-------------------------]| [2:-------------------------]| {11:[No Name] }| - | + [3:-------------------------]| ## grid 2 ^ | {1:~ }| {1:~ }| {1:~ }| - ]]) + ## grid 3 + | + ]]} end) it('has minimum width/height values', function() screen:try_resize(1, 1) - screen:expect([[ + screen:expect{grid=[[ ## grid 1 [2:------------]| {11:[No Name] }| - | + [3:------------]| ## grid 2 ^ | - ]]) + ## grid 3 + | + ]]} feed('<esc>:ls') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 [2:------------]| {11:[No Name] }| - :ls^ | + [3:------------]| ## grid 2 | - ]]) + ## grid 3 + :ls^ | + ]]} end) end) describe('grid of smaller inner size', function() it('is rendered correctly', function() screen:try_resize_grid(2, 8, 5) - screen:expect([[ + + screen:expect{grid=[[ ## grid 1 [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -771,21 +809,24 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {11:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 ^ | {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ## grid 3 + | + ]]} end) end) describe('grid of bigger inner size', function() it('is rendered correctly', function() screen:try_resize_grid(2, 80, 20) - screen:expect([[ + + screen:expect{grid=[[ ## grid 1 [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -800,7 +841,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {11:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 ^ | {1:~ }| @@ -822,7 +863,9 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ## grid 3 + | + ]]} end) end) @@ -833,7 +876,8 @@ describe('ext_multigrid', function() end) it('gets written till grid width', function() insert(('a'):rep(60).."\n") - screen:expect([[ + + screen:expect{grid=[[ ## grid 1 [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -848,7 +892,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {11:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| ^ | @@ -870,12 +914,14 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ## grid 3 + | + ]]} end) it('wraps with grid width', function() insert(('b'):rep(80).."\n") - screen:expect([[ + screen:expect{grid=[[ ## grid 1 [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -890,7 +936,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {11:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb| bbbbbbbbbbbbbbbbbbbb | @@ -912,13 +958,15 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ## grid 3 + | + ]]} end) it('displays messages with default grid width', function() command('echomsg "this is a very very very very very very very very'.. ' long message"') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -933,7 +981,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {11:[No Name] }| - this is a very very very...ry very very long message | + [3:-----------------------------------------------------]| ## grid 2 ^ | {1:~ }| @@ -955,13 +1003,15 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ## grid 3 + this is a very very very...ry very very long message | + ]]} end) it('creates folds with grid width', function() insert('this is a fold\nthis is inside fold\nthis is outside fold') feed('kzfgg') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -976,7 +1026,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {11:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 {13:^+-- 2 lines: this is a fold································}| this is outside fold | @@ -998,21 +1048,23 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ## grid 3 + | + ]]} end) end) it('multiline messages scroll over windows', function() command('sp') command('vsp') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| {11:[No Name] }{12:[No Name] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -1020,7 +1072,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -1028,38 +1080,40 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 5 ^ | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} feed(":echoerr 'very' | echoerr 'much' | echoerr 'fail'<cr>") - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| {11:[No Name] }{12:[No Name] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| - {11: }| - {14:very} | - {14:much} | - {14:fail} | - {15:Press ENTER or type command to continue}^ | + [2:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -1067,30 +1121,35 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + {14:very} | + {14:much} | + {14:fail} | + {15:Press ENTER or type command to continue}^ | + ## grid 4 | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 5 | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} feed('<cr>') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| {11:[No Name] }{12:[No Name] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -1098,7 +1157,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -1106,20 +1165,22 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 5 ^ | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} command([[ func! ErrMsg() @@ -1128,8 +1189,29 @@ describe('ext_multigrid', function() endfor endfunc]]) feed(":call ErrMsg()<cr>") - screen:expect([[ + screen:expect{grid=[[ ## grid 1 + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + [3:-----------------------------------------------------]| + ## grid 2 + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + ## grid 3 {14:Error detected while processing function ErrMsg:} | {19:line 2:} | {14:error 0} | @@ -1144,37 +1226,31 @@ describe('ext_multigrid', function() {14:error 9} | {14:error 10} | {15:Press ENTER or type command to continue}^ | - ## grid 2 - | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - ## grid 3 + ## grid 4 | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 5 | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} feed("<c-c>") - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| - [4:--------------------------]{12:│}[3:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| + [5:--------------------------]{12:│}[4:--------------------------]| {11:[No Name] }{12:[No Name] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -1182,7 +1258,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -1190,40 +1266,42 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 5 ^ | {1:~ }| {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} end) it('handles switch tabs', function() command('vsp') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| {11:[No Name] }{12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -1238,6 +1316,8 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 ^ | {1:~ }| {1:~ }| @@ -1250,27 +1330,27 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} command('tabnew') -- note the old grids aren't resized yet - screen:expect([[ + screen:expect{grid=[[ ## grid 1 {16: }{17:2}{16: [No Name] }{7: [No Name] }{12: }{16:X}| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| + [5:-----------------------------------------------------]| {11:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 (hidden) | {1:~ }| @@ -1284,7 +1364,9 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ## grid 3 (hidden) + ## grid 3 + | + ## grid 4 (hidden) | {1:~ }| {1:~ }| @@ -1297,7 +1379,7 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 5 ^ | {1:~ }| {1:~ }| @@ -1309,25 +1391,25 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} command('sp') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 {16: }{17:2}{16: [No Name] }{7: }{18:2}{7: [No Name] }{12: }{16:X}| + [6:-----------------------------------------------------]| + [6:-----------------------------------------------------]| + [6:-----------------------------------------------------]| + [6:-----------------------------------------------------]| + [6:-----------------------------------------------------]| + {11:[No Name] }| [5:-----------------------------------------------------]| [5:-----------------------------------------------------]| [5:-----------------------------------------------------]| [5:-----------------------------------------------------]| [5:-----------------------------------------------------]| - {11:[No Name] }| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| {12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 (hidden) | {1:~ }| @@ -1341,7 +1423,9 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ## grid 3 (hidden) + ## grid 3 + | + ## grid 4 (hidden) | {1:~ }| {1:~ }| @@ -1354,37 +1438,37 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 5 | {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 5 + ## grid 6 ^ | {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} command('tabnext') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 {7: }{18:2}{7: [No Name] }{16: }{17:2}{16: [No Name] }{12: }{16:X}| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| {11:[No Name] }{12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -1398,6 +1482,8 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 ^ | {1:~ }| {1:~ }| @@ -1409,37 +1495,37 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ## grid 4 (hidden) + ## grid 5 (hidden) | {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 5 (hidden) + ## grid 6 (hidden) | {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} command('tabnext') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 {16: }{17:2}{16: [No Name] }{7: }{18:2}{7: [No Name] }{12: }{16:X}| + [6:-----------------------------------------------------]| + [6:-----------------------------------------------------]| + [6:-----------------------------------------------------]| + [6:-----------------------------------------------------]| + [6:-----------------------------------------------------]| + {11:[No Name] }| [5:-----------------------------------------------------]| [5:-----------------------------------------------------]| [5:-----------------------------------------------------]| [5:-----------------------------------------------------]| [5:-----------------------------------------------------]| - {11:[No Name] }| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| - [4:-----------------------------------------------------]| {12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 (hidden) | {1:~ }| @@ -1452,7 +1538,9 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ## grid 3 (hidden) + ## grid 3 + | + ## grid 4 (hidden) | {1:~ }| {1:~ }| @@ -1464,37 +1552,37 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ## grid 4 + ## grid 5 | {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ## grid 5 + ## grid 6 ^ | {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} command('tabclose') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| - [3:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| {11:[No Name] }{12:[No Name] }| - | + [3:-----------------------------------------------------]| ## grid 2 | {1:~ }| @@ -1509,6 +1597,8 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 ^ | {1:~ }| {1:~ }| @@ -1521,12 +1611,12 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} end) it('supports mouse', function() insert('some text\nto be clicked') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -1541,7 +1631,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {11:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 some text | to be clicke^d | @@ -1555,10 +1645,12 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ## grid 3 + | + ]]} meths.input_mouse('left', 'press', '', 2, 0, 5) - screen:expect([[ + screen:expect{grid=[[ ## grid 1 [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -1573,7 +1665,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {11:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 some ^text | to be clicked | @@ -1587,19 +1679,21 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ## grid 3 + | + ]]} feed(':new<cr>') insert('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmo') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| {11:[No Name] [+] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -1607,7 +1701,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 some text | to be clicked | @@ -1615,23 +1709,25 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 Lorem ipsum dolor sit amet, consectetur adipiscing el| it, sed do eiusm^o | {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} meths.input_mouse('left', 'press', '', 2, 1, 6) - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| {12:[No Name] [+] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -1639,7 +1735,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {11:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 some text | to be ^clicked | @@ -1647,23 +1743,25 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 Lorem ipsum dolor sit amet, consectetur adipiscing el| it, sed do eiusmo | {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} - meths.input_mouse('left', 'press', '', 3, 1, 4) - screen:expect([[ + meths.input_mouse('left', 'press', '', 4, 1, 4) + screen:expect{grid=[[ ## grid 1 - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| {11:[No Name] [+] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -1671,7 +1769,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 some text | to be clicked | @@ -1679,23 +1777,25 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 Lorem ipsum dolor sit amet, consectetur adipiscing el| it, ^sed do eiusmo | {1:~ }| {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} - screen:try_resize_grid(3, 80, 2) - screen:expect([[ + screen:try_resize_grid(4, 80, 2) + screen:expect{grid=[[ ## grid 1 - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| {11:[No Name] [+] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -1703,7 +1803,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 some text | to be clicked | @@ -1711,19 +1811,21 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 Lorem ipsum dolor sit amet, consectetur adipiscing elit, ^sed do eiusmo | {1:~ }| - ]]) + ]]} - meths.input_mouse('left', 'press', '', 3, 0, 64) - screen:expect([[ + meths.input_mouse('left', 'press', '', 4, 0, 64) + screen:expect{grid=[[ ## grid 1 - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| {11:[No Name] [+] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -1731,7 +1833,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 some text | to be clicked | @@ -1739,9 +1841,11 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do ^eiusmo | {1:~ }| - ]]) + ]]} meths.input_mouse('left', 'press', '', 1,6, 20) -- TODO(bfredl): "batching" input_mouse is formally not supported yet. @@ -1749,12 +1853,12 @@ describe('ext_multigrid', function() -- but add a wait be sure. wait() meths.input_mouse('left', 'drag', '', 1, 4, 20) - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| {11:[No Name] [+] }| [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| @@ -1764,7 +1868,7 @@ describe('ext_multigrid', function() [2:-----------------------------------------------------]| [2:-----------------------------------------------------]| {12:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 some text | to be clicked | @@ -1774,27 +1878,29 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do ^eiusmo | {1:~ }| - ]]) + ]]} feed('<c-w><c-w><c-w>v') - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| {12:[No Name] [+] }| - [4:--------------------------]{12:│}[2:--------------------------]| - [4:--------------------------]{12:│}[2:--------------------------]| - [4:--------------------------]{12:│}[2:--------------------------]| - [4:--------------------------]{12:│}[2:--------------------------]| - [4:--------------------------]{12:│}[2:--------------------------]| - [4:--------------------------]{12:│}[2:--------------------------]| - [4:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| + [5:--------------------------]{12:│}[2:--------------------------]| {11:[No Name] [+] }{12:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 some text | to be clicked | @@ -1804,9 +1910,11 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmo | {1:~ }| - ## grid 4 + ## grid 5 some text | to be ^clicked | {1:~ }| @@ -1814,27 +1922,27 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} meths.input_mouse('left', 'press', '', 1,8, 26) wait() meths.input_mouse('left', 'drag', '', 1, 6, 30) - screen:expect([[ + screen:expect{grid=[[ ## grid 1 - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| - [3:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| + [4:-----------------------------------------------------]| {12:[No Name] [+] }| - [4:------------------------------]{12:│}[2:----------------------]| - [4:------------------------------]{12:│}[2:----------------------]| - [4:------------------------------]{12:│}[2:----------------------]| - [4:------------------------------]{12:│}[2:----------------------]| - [4:------------------------------]{12:│}[2:----------------------]| - [4:------------------------------]{12:│}[2:----------------------]| - [4:------------------------------]{12:│}[2:----------------------]| + [5:------------------------------]{12:│}[2:----------------------]| + [5:------------------------------]{12:│}[2:----------------------]| + [5:------------------------------]{12:│}[2:----------------------]| + [5:------------------------------]{12:│}[2:----------------------]| + [5:------------------------------]{12:│}[2:----------------------]| + [5:------------------------------]{12:│}[2:----------------------]| + [5:------------------------------]{12:│}[2:----------------------]| {11:[No Name] [+] }{12:[No Name] [+] }| - | + [3:-----------------------------------------------------]| ## grid 2 some text | to be clicked | @@ -1844,9 +1952,11 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| ## grid 3 + | + ## grid 4 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmo | {1:~ }| - ## grid 4 + ## grid 5 some text | to be ^clicked | {1:~ }| @@ -1854,6 +1964,6 @@ describe('ext_multigrid', function() {1:~ }| {1:~ }| {1:~ }| - ]]) + ]]} end) end) diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index c4cfc9d8d3..1db6a5150e 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -1128,7 +1128,7 @@ describe('builtin popupmenu', function() prefix | bef{n: word } | tex{n: }^ | - {2:-- }{s: text } | + {2:-- INSERT -} | ]]) -- can't draw the pum, but check we don't crash @@ -1597,6 +1597,54 @@ describe('builtin popupmenu', function() ]]) end) + it('works with wildoptions=pum with scrolled mesages ', function() + screen:try_resize(40,10) + command('set wildmenu') + command('set wildoptions=pum') + + feed(':echoerr "fail"|echoerr "error"<cr>') + screen:expect{grid=[[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {4: }| + {6:fail} | + {6:error} | + {5:Press ENTER or type command to continue}^ | + ]]} + + feed(':sign <tab>') + screen:expect{grid=[[ + | + {1:~ }| + {1:~ }| + {1:~ }{s: define }{1: }| + {1:~ }{n: jump }{1: }| + {1:~ }{n: list }{1: }| + {4: }{n: place }{4: }| + {6:fail} {n: undefine } | + {6:error}{n: unplace } | + :sign define^ | + ]]} + + feed('d') + screen:expect{grid=[[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {4: }| + {6:fail} | + {6:error} | + :sign defined^ | + ]]} + end) + it("'pumblend' RGB-color", function() screen:try_resize(60,14) screen:set_default_attr_ids({ diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 36fe46fd13..02be714e0d 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -159,6 +159,8 @@ function Screen.new(width, height) wildmenu_selected = nil, win_position = {}, float_pos = {}, + msg_grid = nil, + msg_grid_pos = nil, _session = nil, messages = {}, msg_history = {}, @@ -676,13 +678,12 @@ function Screen:_handle_grid_resize(grid, width, height) } end -function Screen:_handle_win_scroll_over_start() - self.scroll_over = true - self.scroll_over_pos = self._grids[1].height -end -function Screen:_handle_win_scroll_over_reset() - self.scroll_over = false +function Screen:_handle_msg_set_pos(grid, row, scrolled, char) + self.msg_grid = grid + self.msg_grid_pos = row + self.msg_scrolled = scrolled + self.msg_sep_char = char end function Screen:_handle_flush() @@ -823,10 +824,6 @@ function Screen:_handle_scroll(count) end function Screen:_handle_grid_scroll(g, top, bot, left, right, rows, cols) - if self.scroll_over and g == 1 and top < self.scroll_over_pos then - self.scroll_over_pos = top - end - top = top+1 left = left+1 assert(cols == 0) @@ -1076,10 +1073,10 @@ function Screen:_row_repr(gridnr, rownr, attr_state, cursor) local current_attr_id local i = 1 local has_windows = self._options.ext_multigrid and gridnr == 1 - if self.scroll_over and self.scroll_over_pos < rownr then - has_windows = false - end local row = self._grids[gridnr].rows[rownr] + if has_windows and self.msg_grid and self.msg_grid_pos < rownr then + return '['..self.msg_grid..':'..string.rep('-',#row)..']' + end while i <= #row do local did_window = false if has_windows then @@ -1218,12 +1215,17 @@ function Screen:render(headers, attr_state, preview) for igrid,grid in pairs(self._grids) do if headers then local suffix = "" - if igrid > 1 and self.win_position[igrid] == nil and self.float_pos[igrid] == nil then + if igrid > 1 and self.win_position[igrid] == nil + and self.float_pos[igrid] == nil and self.msg_grid ~= igrid then suffix = " (hidden)" end table.insert(rv, "## grid "..igrid..suffix) end - for i = 1, grid.height do + local height = grid.height + if igrid == self.msg_grid then + height = self._grids[1].height - self.msg_grid_pos + end + for i = 1, height do local cursor = self._cursor.grid == igrid and self._cursor.row == i local prefix = (headers or preview) and " " or "" table.insert(rv, prefix..self:_row_repr(igrid, i, attr_state, cursor).."|") @@ -1302,6 +1304,7 @@ function Screen:print_snapshot(attrs, ignore) end attrstr = (", attr_ids={\n"..table.concat(attrstrs, "\n").."\n}") end + print( "\nscreen:expect{grid=[[") print(kwargs.grid) io.stdout:write( "]]"..attrstr) |