From 64a14026d76ba1798d91e15a941fcb6af7cbc5ad Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Wed, 29 Nov 2023 22:16:09 +0200 Subject: feat(highlight): update default color scheme Problem: Default color scheme is suboptimal. Solution: Start using new color scheme. Introduce new `vim` color scheme for opt-in backward compatibility. ------ Main design ideas - Be "Neovim branded". - Be minimal for 256 colors with a bit more shades for true colors. - Be accessible through high enough contrast ratios. - Be suitable for dark and light backgrounds via exchange of dark and light palettes. ------ Palettes - Have dark and light variants. Implemented through exporeted `NvimDark*` and `NvimLight*` hex colors. - Palettes have 4 shades of grey for UI elements and 6 colors (red, yellow, green, cyan, blue, magenta). - Actual values are computed procedurally in Oklch color space based on a handful of hyperparameters. - Each color has a 256 colors variant with perceptually closest color. ------ Highlight groups Use: - Grey shades for general UI according to their design. - Bold text for keywords (`Statement` highlight group). This is an important choice to increase accessibility for people with color deficiencies, as it doesn't rely on actual color. - Green for strings, `DiffAdd` (as background), `DiagnosticOk`, and some minor text UI elements. - Cyan as main syntax color, i.e. for function usage (`Function` highlight group), `DiffText`, `DiagnosticInfo`, and some minor text UI elements. - Red to generally mean high user attention, i.e. errors; in particular for `ErrorMsg`, `DiffDelete`, `DiagnosticError`. - Yellow very sparingly only with true colors to mean mild user attention, i.e. warnings. That is, `DiagnosticWarn` and `WarningMsg`. - Blue very sparingly only with true colors as `DiagnosticHint` and some additional important syntax group (like `Identifier`). - Magenta very carefully (if at all). ------ Notes - To make tests work without relatively larege updates, each one is prepended with an equivalent of the call `:colorscheme vim`. Plus some tests which spawn new Neovim instances also now use 'vim' color scheme. In some cases tests are updated to fit new default color scheme. --- test/functional/ui/float_spec.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/functional/ui/float_spec.lua') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 2902b4a4a5..eca8ee6422 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -1185,7 +1185,7 @@ describe('float window', function() it('defaults to NormalFloat highlight and inherited options', function() command('set number') - command('hi NormalFloat guibg=#333333') + command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ixygg') local win = meths.open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10}) if multigrid then @@ -1271,7 +1271,7 @@ describe('float window', function() command('set colorcolumn=1') command('set cursorline') command('set foldcolumn=1') - command('hi NormalFloat guibg=#333333') + command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ixygg') local win = meths.open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) if multigrid then @@ -1399,7 +1399,7 @@ describe('float window', function() command('set colorcolumn=1') command('set cursorline') command('set foldcolumn=1') - command('hi NormalFloat guibg=#333333') + command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ixygg') local win = meths.open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) if multigrid then @@ -1528,7 +1528,7 @@ describe('float window', function() command('set cursorline') command('set foldcolumn=1') command('set statuscolumn=%l%s%C') - command('hi NormalFloat guibg=#333333') + command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ixygg') meths.open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) if multigrid then @@ -5921,7 +5921,7 @@ describe('float window', function() describe('float shown after pum', function() local win before_each(function() - command('hi NormalFloat guibg=#333333') + command('hi NormalFloat guibg=#333333 guifg=NONE') feed('i') funcs.complete(1, {'aa', 'word', 'longtext'}) if multigrid then -- cgit From 1037ce2e461034a20e35ad59969fd05d5ad68b91 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 9 Dec 2023 20:42:00 +0800 Subject: test: avoid repeated screen lines in expected states This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g --- test/functional/ui/float_spec.lua | 3594 +++++++------------------------------ 1 file changed, 658 insertions(+), 2936 deletions(-) (limited to 'test/functional/ui/float_spec.lua') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index eca8ee6422..5a78e2baa9 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -878,20 +878,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -904,8 +895,7 @@ describe('float window', function() {0:~ }| {0:~ }{1: }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -917,20 +907,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -941,10 +922,7 @@ describe('float window', function() screen:expect([[ ^ {1: } | {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 | ]]) end @@ -953,31 +931,18 @@ describe('float window', function() if multigrid then screen:expect([[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ]]) else screen:expect([[ ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 | ]]) end @@ -992,27 +957,17 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| + [2:-------------------]{5:│}[4:--------------------]|*5 {5:[No Name] }{4:[No Name] }| [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 5 {1: }| {2:~ }| @@ -1064,20 +1019,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -1090,8 +1036,7 @@ describe('float window', function() {0:~ }| {0:~ }{1: }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -1103,20 +1048,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -1127,10 +1063,7 @@ describe('float window', function() screen:expect([[ ^ {1: } | {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 | ]]) end @@ -1139,31 +1072,18 @@ describe('float window', function() if multigrid then screen:expect([[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ]]) else screen:expect([[ ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 | ]]) end @@ -1191,20 +1111,13 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 {14: 1 }^x | {14: 2 }y | {14: 3 } | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 @@ -1230,36 +1143,25 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 {14: 1 }^x | {14: 2 }y | {14: 3 } | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 {18: 1 }{15: }| - {16:~ }| - {16:~ }| - {16:~ }| + {16:~ }|*3 ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} else screen:expect([[ {14: 1 }^x | {14: 2 }y | {14: 3 } {18: 1 }{15: } | - {0:~ }{16:~ }{0: }| - {0:~ }{16:~ }{0: }| - {0:~ }{16:~ }{0: }| + {0:~ }{16:~ }{0: }|*3 | ]]) end @@ -1277,27 +1179,19 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 {19: }{20: 1 }{22:^x}{21: }| {19: }{14: 2 }{22:y} | {19: }{14: 3 }{22: } | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 {15:x }| {15:y }| - {15: }| - {15: }| + {15: }|*2 ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} else screen:expect{grid=[[ @@ -1305,8 +1199,7 @@ describe('float window', function() {19: }{14: 2 }{22:y} | {19: }{14: 3 }{22: } {15:x } | {0:~ }{15:y }{0: }| - {0:~ }{15: }{0: }| - {0:~ }{15: }{0: }| + {0:~ }{15: }{0: }|*2 | ]]} end @@ -1317,20 +1210,13 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 {19: }{17:𐌢̀́̂̃̅̄𐌢̀́̂̃̅̄}{20: 1 }{22:^x}{21: }| {19: }{14: 2 }{22:y} | {19: }{14: 3 }{22: } | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 @@ -1358,36 +1244,24 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 {19: }{20: 1 }{22:^x}{21: }| {19: }{14: 2 }{22:y} | {19: }{14: 3 }{22: } | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 - {15: }| - {15: }| - {15: }| - {15: }| + {15: }|*4 ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} else screen:expect([[ {19: }{20: 1 }{22:^x}{21: }| {19: }{14: 2 }{22:y} | {19: }{14: 3 }{22: } {15: } | - {0:~ }{15: }{0: }| - {0:~ }{15: }{0: }| - {0:~ }{15: }{0: }| + {0:~ }{15: }{0: }|*3 | ]]) end @@ -1405,27 +1279,19 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 {19: }{20: 1 }{22:^x}{21: }| {19: }{14: 2 }{22:y} | {19: }{14: 3 }{22: } | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 {15:x }| {15:y }| - {15: }| - {15: }| + {15: }|*2 ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} else screen:expect{grid=[[ @@ -1433,8 +1299,7 @@ describe('float window', function() {19: }{14: 2 }{22:y} | {19: }{14: 3 }{22: } {15:x } | {0:~ }{15:y }{0: }| - {0:~ }{15: }{0: }| - {0:~ }{15: }{0: }| + {0:~ }{15: }{0: }|*2 | ]]} end @@ -1445,20 +1310,13 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 {19: }{17:𐌢̀́̂̃̅̄𐌢̀́̂̃̅̄}{20: 1 }{22:^x}{21: }| {19: }{14: 2 }{22:y} | {19: }{14: 3 }{22: } | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 @@ -1486,36 +1344,24 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 {19: }{20: 1 }{22:^x}{21: }| {19: }{14: 2 }{22:y} | {19: }{14: 3 }{22: } | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 - {15: }| - {15: }| - {15: }| - {15: }| + {15: }|*4 ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} else screen:expect([[ {19: }{20: 1 }{22:^x}{21: }| {19: }{14: 2 }{22:y} | {19: }{14: 3 }{22: } {15: } | - {0:~ }{15: }{0: }| - {0:~ }{15: }{0: }| - {0:~ }{15: }{0: }| + {0:~ }{15: }{0: }|*3 | ]]) end @@ -1534,27 +1380,19 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 {20:1}{19: }{20: }{22:^x}{21: }| {14:2}{19: }{14: }{22:y} | {14:3}{19: }{14: }{22: } | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 {15:x }| {15:y }| - {15: }| - {15: }| + {15: }|*2 ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} else screen:expect{grid=[[ @@ -1562,8 +1400,7 @@ describe('float window', function() {14:2}{19: }{14: }{22:y} | {14:3}{19: }{14: }{22: } {15:x } | {0:~ }{15:y }{0: }| - {0:~ }{15: }{0: }| - {0:~ }{15: }{0: }| + {0:~ }{15: }{0: }|*2 | ]]} end @@ -1578,20 +1415,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -1621,20 +1449,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -1664,20 +1483,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -1707,20 +1517,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -1751,20 +1552,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -1794,20 +1586,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -1825,8 +1608,7 @@ describe('float window', function() {0:~ }| {0:~ }{1: halloj! }{0: }| {0:~ }{1: BORDAA }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]} end @@ -1835,20 +1617,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -1866,8 +1639,7 @@ describe('float window', function() {0:~ }| {0:~ }{5:<}{1: halloj! }{5:>}{0: }| {0:~ }{5:<}{1: BORDAA }{5:>}{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]} end @@ -1876,20 +1648,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -1927,12 +1690,7 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 neeed some dummy | @@ -2046,20 +1804,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -2101,20 +1850,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -2144,20 +1884,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -2187,20 +1918,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -2230,20 +1952,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -2282,20 +1995,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -2325,20 +2029,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -2368,20 +2063,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -2411,20 +2097,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -2463,20 +2140,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -2506,20 +2174,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -2549,20 +2208,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -2597,20 +2247,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -2643,31 +2284,17 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 {5:┌────────────────────────────────────────┐}| {5:│}{1: }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| + {5:│}{2:~ }{5:│}|*6 {5:└────────────────────────────────────────┘}| ]], float_pos={ [4] = { { id = 1001 }, "NW", 1, 0, 0, true, 201 } @@ -2679,10 +2306,7 @@ describe('float window', function() screen:expect{grid=[[ {5:^┌──────────────────────────────────────┐}| {5:│}{1: }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| + {5:│}{2:~ }{5:│}|*4 {5:└──────────────────────────────────────┘}| ]]} end @@ -2699,26 +2323,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*9 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*8 ## grid 3 | ## grid 4 @@ -2740,10 +2349,7 @@ describe('float window', function() {0:~ }{5:║}{1:abb acc }{5:║}{0: }| {0:~ }{5:║}{1:^ }{5:║}{0: }| {0:~ }{5:╚═════════╝}{0: }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 | ]]} end @@ -2752,26 +2358,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*9 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*8 ## grid 3 {3:-- }{8:match 1 of 4} | ## grid 4 @@ -2811,26 +2402,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*9 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*8 ## grid 3 | ## grid 4 @@ -2852,10 +2428,7 @@ describe('float window', function() {0:~ }{5:║}{1:abb acc }{5:║}{0: }| {0:~ }{5:║}{1:ac^c }{5:║}{0: }| {0:~ }{5:╚═════════╝}{0: }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 | ]]} end @@ -2869,26 +2442,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*9 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*8 ## grid 3 :popup Test | ## grid 4 @@ -2917,8 +2475,7 @@ describe('float window', function() {0:~ }{5:╚═}{1: foo }{5:═══╝}{0: }| {0:~ }{1: bar }{0: }| {0:~ }{1: baz }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 :popup Test | ]]} end @@ -2935,20 +2492,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 1,1 All | ## grid 4 @@ -2966,9 +2514,7 @@ describe('float window', function() {1:^aaa aab } | {0:~ }{1:abb acc }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 1,1 All | ]]} end @@ -2977,20 +2523,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 1,5 All | ## grid 4 @@ -3008,9 +2545,7 @@ describe('float window', function() {1:aaa ^aab } | {0:~ }{1:abb acc }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 1,5 All | ]]} end @@ -3022,26 +2557,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 fish:<>< | ## grid 4 {1:^ }| - {2:~ }| - {2:~ }| + {2:~ }|*2 ]], float_pos={ [4] = {{id = 1001}, "NW", 1, 0, 5, true, 50}; }, win_viewport={ @@ -3051,11 +2576,8 @@ describe('float window', function() else screen:expect{grid=[[ {1:^ } | - {0:~ }{2:~ }{0: }| - {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }{2:~ }{0: }|*2 + {0:~ }|*3 fish:<>< | ]]} end @@ -3072,34 +2594,19 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| + [2:--------------------------------------------------]|*8 [3:--------------------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*7 ## grid 3 0,0-1 All | ## grid 4 {1: }| - {2:~ }| - {2:~ }| + {2:~ }|*2 ## grid 5 {1:^ }| - {2:~ }| - {2:~ }| + {2:~ }|*2 ]], float_pos={ [5] = {{id = 1002}, "NW", 1, 0, 5, true, 50}; [4] = {{id = 1001}, "NW", 1, 0, 0, true, 50}; @@ -3111,13 +2618,8 @@ describe('float window', function() else screen:expect{grid=[[ {1: } {1:^ } | - {2:~ }{0: }{2:~ }{0: }| - {2:~ }{0: }{2:~ }{0: }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {2:~ }{0: }{2:~ }{0: }|*2 + {0:~ }|*5 0,0-1 All | ]]} end @@ -3125,34 +2627,19 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| + [2:--------------------------------------------------]|*8 [3:--------------------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*7 ## grid 3 {3:-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)} | ## grid 4 {1: }| - {2:~ }| - {2:~ }| + {2:~ }|*2 ## grid 5 {1:^ }| - {2:~ }| - {2:~ }| + {2:~ }|*2 ]], float_pos={ [5] = {{id = 1002}, "NW", 1, 0, 5, true, 50}; [4] = {{id = 1001}, "NW", 1, 0, 0, true, 50}; @@ -3164,13 +2651,8 @@ describe('float window', function() else screen:expect{grid=[[ {1: } {1:^ } | - {2:~ }{0: }{2:~ }{0: }| - {2:~ }{0: }{2:~ }{0: }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {2:~ }{0: }{2:~ }{0: }|*2 + {0:~ }|*5 {3:-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)} | ]]} end @@ -3184,20 +2666,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 the background tex^t | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -3208,11 +2681,7 @@ describe('float window', function() else screen:expect([[ the {1:x}ackground tex^t | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 | ]]) end @@ -3221,20 +2690,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 the background tex^t | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -3245,11 +2705,7 @@ describe('float window', function() else screen:expect([[ the background {1:x}ex^t | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 | ]]) end @@ -3258,31 +2714,18 @@ describe('float window', function() if multigrid then screen:expect([[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 the background tex^t | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ]]) else screen:expect([[ the background tex^t | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 | ]]) end @@ -3309,17 +2752,13 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [8:----------------------------------------]| - [8:----------------------------------------]| + [8:----------------------------------------]|*2 {4:X6 }| - [7:----------------------------------------]| - [7:----------------------------------------]| + [7:----------------------------------------]|*2 {5:X5 }| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*2 {5:X2 }| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {5:X1 }| [3:----------------------------------------]| ## grid 2 @@ -3471,13 +2910,9 @@ describe('float window', function() if multigrid then screen:expect([[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*3 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*3 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -3511,13 +2946,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*3 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*3 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -3554,13 +2985,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*3 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*3 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -3597,13 +3024,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*3 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*3 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -3640,13 +3063,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*3 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*3 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -3683,13 +3102,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*3 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*3 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -3726,13 +3141,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*3 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*3 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -3802,47 +3213,31 @@ describe('float window', function() if multigrid then screen:expect([[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*5 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*5 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 just some example text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 just some exampl^e text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ]]) else screen:expect([[ just some example text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 {5:[No Name] [+] }| just some exampl^e text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 {4:[No Name] [+] }| | ]]) @@ -3856,33 +3251,21 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*5 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*5 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 just some example text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 just some exampl^e text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 5 {5:╔═════════╗}| {5:║}{1: halloj! }{5:║}| @@ -3895,9 +3278,7 @@ describe('float window', function() screen:expect([[ just some example text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 {5:[No Name] [+] }| just some exampl^e text | some more exam{5:╔═════════╗} | @@ -3913,33 +3294,21 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*5 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*5 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 just some example text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 just some exampl^e text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 5 {5:╔═════════╗}| {5:║}{1: halloj! }{5:║}| @@ -3952,9 +3321,7 @@ describe('float window', function() screen:expect([[ just some example text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 {5:[No Name] [+] }| jus{5:╔═════════╗}pl^e text | som{5:║}{1: halloj! }{5:║}ple text | @@ -3970,33 +3337,21 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*5 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*5 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 just some example text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 just some exampl^e text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 5 {5:╔═════════╗}| {5:║}{1: halloj! }{5:║}| @@ -4015,9 +3370,7 @@ describe('float window', function() {5:[No║}{1: BORDAA }{5:║ }| jus{5:╚═════════╝}pl^e text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 {4:[No Name] [+] }| | ]]) @@ -4027,33 +3380,21 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*5 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*5 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 just some example text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 just some exampl^e text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 5 {5:╔═════════╗}| {5:║}{1: halloj! }{5:║}| @@ -4072,9 +3413,7 @@ describe('float window', function() {5:[No Name] [+] ╚═════════╝ }| just some exampl^e text | some more example text | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 {4:[No Name] [+] }| | ]]) @@ -4121,20 +3460,12 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 - | - | - | + |*3 ^ | - {0:~ }| - {0:~ }| + {0:~ }|*2 ## grid 3 | ## grid 5 @@ -4169,8 +3500,7 @@ describe('float window', function() {1:5 } {1:1 } {1:6 } {1:2 } | {1:3 } {1:4 } | ^ | - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -4197,20 +3527,12 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 - | - | - | + |*3 ^ | - {0:~ }| - {0:~ }| + {0:~ }|*2 ## grid 3 | ## grid 5 @@ -4245,8 +3567,7 @@ describe('float window', function() {1:6 } {1:8 } {1:3 } {1:4 } | {1:2 } {1:1 } | ^ | - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -4280,10 +3601,7 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:------------------------------]| - [2:------------------------------]| - [2:------------------------------]| - [2:------------------------------]| + [2:------------------------------]|*4 [3:------------------------------]| ## grid 2 ^just some | @@ -4298,8 +3616,7 @@ describe('float window', function() ^just some | example text that is wider tha| n the window | - | - | + |*2 ]]} end @@ -4310,10 +3627,7 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:------------------------------]| - [2:------------------------------]| - [2:------------------------------]| - [2:------------------------------]| + [2:------------------------------]|*4 [3:------------------------------]| ## grid 2 ^just some | @@ -4343,16 +3657,12 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:------------------------------]| - [2:------------------------------]| - [2:------------------------------]| - [2:------------------------------]| + [2:------------------------------]|*4 [3:------------------------------]| ## grid 2 ^example text that is wider tha| n the window | - | - | + |*2 ## grid 3 | ## grid 4 @@ -4365,8 +3675,7 @@ describe('float window', function() ^example text that is wider tha| n the window | {1:some info! } | - | - | + |*2 ]]} end @@ -4375,15 +3684,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:---------------------------------------------]| - [2:---------------------------------------------]| - [2:---------------------------------------------]| - [2:---------------------------------------------]| + [2:---------------------------------------------]|*4 [3:---------------------------------------------]| ## grid 2 ^example text that is wider than the window | - | - | + |*2 more text | ## grid 3 | @@ -4407,26 +3712,14 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| + [2:-------------------------]|*9 [3:-------------------------]| ## grid 2 ^example text that is wide| r than the window | - | - | + |*2 more text | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 @@ -4441,10 +3734,7 @@ describe('float window', function() {1:some info! } | | more text | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 | ]]} end @@ -4453,26 +3743,14 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| + [2:-------------------------]|*9 [3:-------------------------]| ## grid 2 ^example text that is wide| r than the window | - | - | + |*2 more text | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 @@ -4484,13 +3762,9 @@ describe('float window', function() screen:expect{grid=[[ ^example{1:some info! }s wide| r than the window | - | - | + |*2 more text | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 | ]]} end @@ -4500,15 +3774,7 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----]{5:│}[5:--------------------]| - [2:----]{5:│}[5:--------------------]| - [2:----]{5:│}[5:--------------------]| - [2:----]{5:│}[5:--------------------]| - [2:----]{5:│}[5:--------------------]| - [2:----]{5:│}[5:--------------------]| - [2:----]{5:│}[5:--------------------]| - [2:----]{5:│}[5:--------------------]| - [2:----]{5:│}[5:--------------------]| + [2:----]{5:│}[5:--------------------]|*9 [3:-------------------------]| ## grid 2 exam| @@ -4526,14 +3792,7 @@ describe('float window', function() {1:some info! }| ## grid 5 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*8 ]], float_pos={ [4] = { { id = 1001 }, "SW", 2, 8, 0, true } }} @@ -4557,26 +3816,14 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| + [2:-------------------------]|*9 [3:-------------------------]| ## grid 2 ^example text that is wide| r than the window | - | - | + |*2 more text | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 @@ -4591,10 +3838,7 @@ describe('float window', function() {1:some info! } | | more text | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 | ]]} end @@ -4603,26 +3847,14 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| + [2:-------------------------]|*9 [3:-------------------------]| ## grid 2 ^example text that is wide| r than the window | - | - | + |*2 more text | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 @@ -4637,10 +3869,7 @@ describe('float window', function() | {1:some info! } | more text | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 | ]]} end @@ -4649,26 +3878,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| + [2:-------------------------]|*9 [3:-------------------------]| ## grid 2 {28:^+-- 5 lines: just some··}| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*8 ## grid 3 | ## grid 4 @@ -4681,12 +3895,7 @@ describe('float window', function() {28:^+-- 5 lines: just some··}| {0:~ }| {1:some info! }{0: }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*6 | ]]} end @@ -4699,25 +3908,18 @@ describe('float window', function() if multigrid then screen:expect([[ ## grid 1 - [2:------------------------------]| - [2:------------------------------]| - [2:------------------------------]| - [2:------------------------------]| + [2:------------------------------]|*4 [3:------------------------------]| ## grid 2 that is wider than the windo^w | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ]]) else screen:expect([[ that is wider than the windo^w | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 | ]]) end @@ -4728,16 +3930,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:------------------------------]| - [2:------------------------------]| - [2:------------------------------]| - [2:------------------------------]| + [2:------------------------------]|*4 [3:------------------------------]| ## grid 2 that is wider than the windo^w | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 @@ -4748,8 +3945,7 @@ describe('float window', function() else screen:expect([[ that is wider than the windo^w | - {0:~ }| - {0:~ }| + {0:~ }|*2 {0:~}{1:some floaty text }{0: }| | ]]) @@ -4771,11 +3967,7 @@ describe('float window', function() screen:expect{grid=[[ ## grid 1 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 | ## grid 2 {1:^ }| @@ -4786,8 +3978,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:^ }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end) @@ -4804,20 +3995,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -4842,16 +4024,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*4 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 3 | ## grid 4 @@ -4874,14 +4051,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*3 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| + {0:~ }|*2 ## grid 3 | ## grid 4 @@ -4903,8 +4077,7 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 [3:----------------------------------------]| ## grid 2 ^ | @@ -4928,8 +4101,7 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 [3:----------------------------------------]| ## grid 2 | @@ -4954,20 +4126,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -4993,20 +4156,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -5030,20 +4184,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:--------------------------]| - [2:--------------------------]| - [2:--------------------------]| - [2:--------------------------]| - [2:--------------------------]| - [2:--------------------------]| + [2:--------------------------]|*6 [3:--------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -5067,20 +4212,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| - [2:-------------------------]| + [2:-------------------------]|*6 [3:-------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -5104,20 +4240,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:------------------------]| - [2:------------------------]| - [2:------------------------]| - [2:------------------------]| - [2:------------------------]| - [2:------------------------]| + [2:------------------------]|*6 [3:------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -5141,20 +4268,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------]| - [2:----------------]| - [2:----------------]| - [2:----------------]| - [2:----------------]| - [2:----------------]| + [2:----------------]|*6 [3:----------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -5178,20 +4296,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:---------------]| - [2:---------------]| - [2:---------------]| - [2:---------------]| - [2:---------------]| - [2:---------------]| + [2:---------------]|*6 [3:---------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -5215,20 +4324,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:--------------]| - [2:--------------]| - [2:--------------]| - [2:--------------]| - [2:--------------]| - [2:--------------]| + [2:--------------]|*6 [3:--------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -5252,20 +4352,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:------------]| - [2:------------]| - [2:------------]| - [2:------------]| - [2:------------]| - [2:------------]| + [2:------------]|*6 [3:------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -5312,20 +4403,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -5365,19 +4447,12 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*5 {5:[No Name] }| [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 @@ -5402,11 +4477,7 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*5 {5:[Preview] }| [3:----------------------------------------]| ## grid 2 @@ -5435,19 +4506,12 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*5 {5:[No Name] }| [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 @@ -5483,27 +4547,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 {7:^ }| - {12:~ }| - {12:~ }| - {12:~ }| + {12:~ }|*3 ]], float_pos={ [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }} @@ -5512,9 +4565,7 @@ describe('float window', function() | {0:~ }| {0:~ }{7:^ }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| + {0:~ }{12:~ }{0: }|*3 | ]]) end @@ -5526,27 +4577,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ## grid 4 {7:x aa^ }| - {12:~ }| - {12:~ }| - {12:~ }| + {12:~ }|*3 ## grid 5 {13: aa }| {1: word }| @@ -5571,27 +4611,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 {7:x a^a }| - {12:~ }| - {12:~ }| - {12:~ }| + {12:~ }|*3 ]], float_pos={ [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }} @@ -5601,9 +4630,7 @@ describe('float window', function() | {0:~ }| {0:~ }{7:x a^a }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| + {0:~ }{12:~ }{0: }|*3 | ]]) end @@ -5613,27 +4640,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 xx^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ## grid 4 {7:x aa }| - {12:~ }| - {12:~ }| - {12:~ }| + {12:~ }|*3 ## grid 5 {13:xx }| {1:yy }| @@ -5648,8 +4664,7 @@ describe('float window', function() {13:xx }{0: }| {1:yy }{7: }{0: }| {1:zz }{12: }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| + {0:~ }{12:~ }{0: }|*2 {3:-- INSERT --} | ]]) end @@ -5658,27 +4673,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 xx^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ## grid 4 {7:x aa }| - {12:~ }| - {12:~ }| - {12:~ }| + {12:~ }|*3 ]], float_pos={ [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }} @@ -5687,9 +4691,7 @@ describe('float window', function() xx^ | {0:~ }| {0:~ }{7:x aa }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| + {0:~ }{12:~ }{0: }|*3 {3:-- INSERT --} | ]]) end @@ -5701,27 +4703,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 :sign un^ | ## grid 4 {7: }| - {12:~ }| - {12:~ }| - {12:~ }| + {12:~ }|*3 ## grid 5 {1: undefine }| {1: unplace }| @@ -5750,27 +4741,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ## grid 4 {7:x aa^ }| - {12:~ }| - {12:~ }| - {12:~ }| + {12:~ }|*3 ]], float_pos={ [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }, popupmenu={ @@ -5781,9 +4761,7 @@ describe('float window', function() | {0:~ }| {0:~ }{7:x aa^ }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| + {0:~ }{12:~ }{0: }|*3 {3:-- INSERT --} | ]], popupmenu={ anchor = {1, 2, 7}, items = items, pos = 0 @@ -5794,27 +4772,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 {7:x a^a }| - {12:~ }| - {12:~ }| - {12:~ }| + {12:~ }|*3 ]], float_pos={ [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }} @@ -5823,9 +4790,7 @@ describe('float window', function() | {0:~ }| {0:~ }{7:x a^a }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| + {0:~ }{12:~ }{0: }|*3 | ]]) end @@ -5836,27 +4801,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 xx^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ## grid 4 {7:x aa }| - {12:~ }| - {12:~ }| - {12:~ }| + {12:~ }|*3 ]], float_pos={ [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }, popupmenu={ @@ -5867,9 +4821,7 @@ describe('float window', function() xx^ | {0:~ }| {0:~ }{7:x aa }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| + {0:~ }{12:~ }{0: }|*3 {3:-- INSERT --} | ]], popupmenu={ anchor = {1, 0, 0}, items = items, pos = 0 @@ -5880,27 +4832,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 xx^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ## grid 4 {7:x aa }| - {12:~ }| - {12:~ }| - {12:~ }| + {12:~ }|*3 ]], float_pos={ [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, }} @@ -5909,9 +4850,7 @@ describe('float window', function() xx^ | {0:~ }| {0:~ }{7:x aa }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| - {0:~ }{12:~ }{0: }| + {0:~ }{12:~ }{0: }|*3 {3:-- INSERT --} | ]]) end @@ -5927,20 +4866,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 aa^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ## grid 4 @@ -5956,8 +4886,7 @@ describe('float window', function() {13:aa }{0: }| {1:word }{0: }| {1:longtext }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 {3:-- INSERT --} | ]]) end @@ -5968,20 +4897,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 aa^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ## grid 4 @@ -6001,8 +4921,7 @@ describe('float window', function() {13:aa }{15:e info }{0: }| {1:word }{15:ut item }{0: }| {1:longtext }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 {3:-- INSERT --} | ]]) end @@ -6013,20 +4932,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 aa^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ## grid 5 @@ -6040,9 +4950,7 @@ describe('float window', function() aa^ | {0:~ }{15:some info }{0: }| {0:~ }{15:about item }{0: }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 {3:-- INSERT --} | ]]) end @@ -6051,31 +4959,18 @@ describe('float window', function() if multigrid then screen:expect([[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 aa^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ]]) else screen:expect([[ aa^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 {3:-- INSERT --} | ]]) end @@ -6086,20 +4981,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 aa^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ## grid 4 @@ -6115,8 +5001,7 @@ describe('float window', function() {13:aa }{0: }| {1:word }{0: }| {1:longtext }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 {3:-- INSERT --} | ]]) end @@ -6125,31 +5010,18 @@ describe('float window', function() if multigrid then screen:expect([[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 aa^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ]]) else screen:expect([[ aa^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 {3:-- INSERT --} | ]]) end @@ -6165,20 +5037,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6196,8 +5059,7 @@ describe('float window', function() {0:~ }| {0:~ }here {0: }| {0:~ }float {0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]} end @@ -6220,20 +5082,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6246,8 +5099,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6258,20 +5110,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6284,8 +5127,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:^y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6294,20 +5136,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6320,8 +5153,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6334,20 +5166,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ## grid 4 @@ -6360,8 +5183,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 {3:-- INSERT --} | ]]) end @@ -6370,20 +5192,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6396,8 +5209,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6408,20 +5220,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6434,8 +5237,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:^y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6444,20 +5246,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6470,8 +5263,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6482,20 +5274,11 @@ describe('float window', function() meths.input_mouse('left', 'press', '', 4, 0, 0) screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6509,8 +5292,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:^y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6519,20 +5301,11 @@ describe('float window', function() meths.input_mouse('left', 'press', '', 2, 0, 0) screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6546,8 +5319,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6561,20 +5333,12 @@ describe('float window', function() meths.input_mouse('left', 'press', '', 4, 0, 0) screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^x | a | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 @@ -6588,8 +5352,7 @@ describe('float window', function() ^a | {0:~ }{1:y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6598,20 +5361,12 @@ describe('float window', function() meths.input_mouse('left', 'press', '', 2, 0, 0) screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^x | a | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 @@ -6625,8 +5380,7 @@ describe('float window', function() a | {0:~ }{1:y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6637,20 +5391,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- INSERT --} | ## grid 4 @@ -6663,8 +5408,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 {3:-- INSERT --} | ]]) end @@ -6673,20 +5417,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6699,8 +5434,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:^y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6709,20 +5443,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6735,8 +5460,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6748,20 +5472,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6774,8 +5489,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:^y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6784,34 +5498,23 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 {1:^y }| - {2:~ }| - {2:~ }| + {2:~ }|*2 ]], float_pos=expected_pos} else screen:expect([[ x | {0:~ }| {0:~ }{1:^y }{0: }| - {0:~ }{2:~ }{0: }| - {0:~ }{2:~ }{0: }| + {0:~ }{2:~ }{0: }|*2 {0:~ }| | ]]) @@ -6821,20 +5524,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6845,9 +5539,7 @@ describe('float window', function() x | {0:~ }| {0:~ }{1:^y }{0: }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 | ]]) end @@ -6856,36 +5548,23 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 {1:^y }| - {2:~ }| - {2:~ }| - {2:~ }| + {2:~ }|*3 ]], float_pos=expected_pos} else screen:expect([[ x | {0:~ }| {0:~ }{1:^y }{0: }| - {0:~ }{2:~ }{0: }| - {0:~ }{2:~ }{0: }| - {0:~ }{2:~ }{0: }| + {0:~ }{2:~ }{0: }|*3 | ]]) end @@ -6894,38 +5573,21 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 {1:^y }| - {2:~ }| - {2:~ }| - {2:~ }| - {2:~ }| - {2:~ }| + {2:~ }|*5 ]], float_pos=expected_pos} else screen:expect([[ x {1:^y } | - {0:~ }{2:~ }{0: }| - {0:~ }{2:~ }{0: }| - {0:~ }{2:~ }{0: }| - {0:~ }{2:~ }{0: }| - {0:~ }{2:~ }{0: }| + {0:~ }{2:~ }{0: }|*5 | ]]) end @@ -6936,20 +5598,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6962,8 +5615,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:^y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -6972,20 +5624,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -6998,8 +5641,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:^y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -7008,20 +5650,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -7034,8 +5667,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:^y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -7044,20 +5676,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -7070,8 +5693,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:^y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -7080,20 +5702,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -7106,8 +5719,7 @@ describe('float window', function() {0:~ }| {1:^y }| {2:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -7118,11 +5730,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*2 {4:[No Name] [+] }| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {5:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -7153,11 +5763,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*2 {5:[No Name] [+] }| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -7188,11 +5796,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*2 {5:[No Name] [+] }| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {5:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -7224,11 +5830,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*2 {4:[No Name] [+] }| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {5:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -7261,11 +5865,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*2 {4:[No Name] [+] }| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {5:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -7296,11 +5898,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*2 {5:[No Name] [+] }| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -7331,11 +5931,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*2 {5:[No Name] [+] }| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -7368,11 +5966,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*2 {4:[No Name] }| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {5:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -7405,11 +6001,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*2 {4:[No Name] }| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {5:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -7442,19 +6036,12 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:--------------------]{5:│}[2:-------------------]| - [5:--------------------]{5:│}[2:-------------------]| - [5:--------------------]{5:│}[2:-------------------]| - [5:--------------------]{5:│}[2:-------------------]| - [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]|*5 {4:[No Name] [+] }{5:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 @@ -7462,10 +6049,7 @@ describe('float window', function() {2:~ }| ## grid 5 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ]], float_pos=expected_pos} else screen:expect([[ @@ -7485,19 +6069,12 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:--------------------]{5:│}[2:-------------------]| - [5:--------------------]{5:│}[2:-------------------]| - [5:--------------------]{5:│}[2:-------------------]| - [5:--------------------]{5:│}[2:-------------------]| - [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]|*5 {4:[No Name] }{5:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 :vnew | ## grid 4 @@ -7505,10 +6082,7 @@ describe('float window', function() {2:~ }| ## grid 5 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ]], float_pos=expected_pos} else screen:expect([[ @@ -7528,19 +6102,12 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:--------------------]{5:│}[2:-------------------]| - [5:--------------------]{5:│}[2:-------------------]| - [5:--------------------]{5:│}[2:-------------------]| - [5:--------------------]{5:│}[2:-------------------]| - [5:--------------------]{5:│}[2:-------------------]| + [5:--------------------]{5:│}[2:-------------------]|*5 {4:[No Name] }{5:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 :vnew | ## grid 4 @@ -7548,10 +6115,7 @@ describe('float window', function() {2:~ }| ## grid 5 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ]], float_pos=expected_pos} else screen:expect([[ @@ -7596,20 +6160,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -7638,20 +6193,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 :quit | ## grid 4 @@ -7666,8 +6212,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:^y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 :quit | ]]) end @@ -7676,31 +6221,18 @@ describe('float window', function() if multigrid then screen:expect([[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 :quit | ]]) else screen:expect([[ ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 :quit | ]]) end @@ -7713,31 +6245,18 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ]]} else screen:expect([[ ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 | ]]) end @@ -7748,20 +6267,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [3:----------------------------------------]| - [3:----------------------------------------]| - [3:----------------------------------------]| + [2:----------------------------------------]|*4 + [3:----------------------------------------]|*3 ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {7:E5601: Cannot close window, only floatin}| {7:g window would remain} | @@ -7787,20 +6297,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -7813,8 +6314,7 @@ describe('float window', function() {0:~ }| {0:~ }{1:^y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -7825,11 +6325,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*2 {4:[No Name] [+] }| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {5:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -7860,31 +6358,18 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 3 | ## grid 5 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ]]} else screen:expect([[ ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 | ]]) end @@ -7895,11 +6380,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*2 {5:[No Name] [+] }| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {5:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -7930,13 +6413,10 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*2 {5:[No Name] [+] }| [2:----------------------------------------]| - [3:----------------------------------------]| - [3:----------------------------------------]| - [3:----------------------------------------]| + [3:----------------------------------------]|*3 ## grid 2 x | {0:~ }| @@ -7969,11 +6449,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*2 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -8002,19 +6480,12 @@ describe('float window', function() expected_pos = {[4]={external=true}} screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*5 {5:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 @@ -8031,11 +6502,9 @@ describe('float window', function() if multigrid then screen:expect([[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*2 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -8055,20 +6524,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -8093,11 +6553,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*2 {5:[No Name] [+] }| - [4:----------------------------------------]| - [4:----------------------------------------]| + [4:----------------------------------------]|*2 {4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -8128,11 +6586,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [6:--------------------]{5:│}[5:-------------------]| - [6:--------------------]{5:│}[5:-------------------]| + [6:--------------------]{5:│}[5:-------------------]|*2 {5:[No Name] [+] [No Name] [+] }| - [7:--------------------]{5:│}[2:-------------------]| - [7:--------------------]{5:│}[2:-------------------]| + [7:--------------------]{5:│}[2:-------------------]|*2 {4:[No Name] [+] }{5:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -8175,11 +6631,9 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [6:-------------------]{5:│}[5:--------------------]| - [6:-------------------]{5:│}[5:--------------------]| + [6:-------------------]{5:│}[5:--------------------]|*2 {5:[No Name] [+] [No Name] [+] }| - [7:-------------------]{5:│}[2:--------------------]| - [7:-------------------]{5:│}[2:--------------------]| + [7:-------------------]{5:│}[2:--------------------]|*2 {5:[No Name] [+] [No Name] [+] }| [3:----------------------------------------]| ## grid 2 @@ -8253,19 +6707,11 @@ describe('float window', function() screen:expect{grid=[[ ## grid 1 {9: }{10:2}{9:+ [No Name] }{3: [No Name] }{5: }{9:X}| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*5 [3:----------------------------------------]| ## grid 2 (hidden) x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 :tabnew | ## grid 4 (hidden) @@ -8273,19 +6719,13 @@ describe('float window', function() {2:~ }| ## grid 5 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ]]} else screen:expect([[ {9: }{10:2}{9:+ [No Name] }{3: [No Name] }{5: }{9:X}| ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 :tabnew | ]]) end @@ -8295,18 +6735,11 @@ describe('float window', function() screen:expect{grid=[[ ## grid 1 {3: }{11:2}{3:+ [No Name] }{9: [No Name] }{5: }{9:X}| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*5 [3:----------------------------------------]| ## grid 2 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 :tabnext | ## grid 4 @@ -8314,10 +6747,7 @@ describe('float window', function() {2:~ }| ## grid 5 (hidden) | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ]], float_pos=expected_pos} else screen:expect([[ @@ -8325,8 +6755,7 @@ describe('float window', function() ^x | {0:~ }{1:y }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 :tabnext | ]]) end @@ -8336,18 +6765,11 @@ describe('float window', function() screen:expect{grid=[[ ## grid 1 {9: }{10:2}{9:+ [No Name] }{3: [No Name] }{5: }{9:X}| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*5 [3:----------------------------------------]| ## grid 2 (hidden) x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 :tabnext | ## grid 4 (hidden) @@ -8355,19 +6777,13 @@ describe('float window', function() {2:~ }| ## grid 5 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ]]} else screen:expect([[ {9: }{10:2}{9:+ [No Name] }{3: [No Name] }{5: }{9:X}| ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 :tabnext | ]]) end @@ -8382,32 +6798,19 @@ describe('float window', function() screen:expect{grid=[[ ## grid 1 {9: + [No Name] }{3: }{11:2}{3:+ [No Name] }{5: }{9:X}| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*5 [3:----------------------------------------]| ## grid 2 (hidden) x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 :tabnew | ## grid 4 y | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 5 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ]], float_pos=expected_pos} else eq("UI doesn't support external windows", @@ -8419,31 +6822,19 @@ describe('float window', function() screen:expect{grid=[[ ## grid 1 {3: }{11:2}{3:+ [No Name] }{9: [No Name] }{5: }{9:X}| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*5 [3:----------------------------------------]| ## grid 2 ^x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 :tabnext | ## grid 4 y | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 5 (hidden) | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ]], float_pos=expected_pos} end @@ -8452,31 +6843,19 @@ describe('float window', function() screen:expect{grid=[[ ## grid 1 {9: + [No Name] }{3: }{11:2}{3:+ [No Name] }{5: }{9:X}| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| - [5:----------------------------------------]| + [5:----------------------------------------]|*5 [3:----------------------------------------]| ## grid 2 (hidden) x | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 :tabnext | ## grid 4 y | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 ## grid 5 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ]], float_pos=expected_pos} end end) @@ -8489,20 +6868,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -8519,20 +6889,11 @@ describe('float window', function() meths.input_mouse('left', 'press', '', 4, 0, 0) screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -8549,20 +6910,11 @@ describe('float window', function() meths.input_mouse('left', 'drag', '', 4, 1, 2) screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- VISUAL --} | ## grid 4 @@ -8617,20 +6969,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -8649,20 +6992,11 @@ describe('float window', function() meths.input_mouse('left', 'press', '', 4, 1, 1) screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -8681,20 +7015,11 @@ describe('float window', function() meths.input_mouse('left', 'drag', '', 4, 2, 3) screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- VISUAL --} | ## grid 4 @@ -8752,20 +7077,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -8783,20 +7099,11 @@ describe('float window', function() meths.input_mouse('left', 'press', '', 4, 1, 0) screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -8814,20 +7121,11 @@ describe('float window', function() meths.input_mouse('left', 'drag', '', 4, 2, 2) screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 {3:-- VISUAL --} | ## grid 4 @@ -8884,87 +7182,62 @@ describe('float window', function() if multigrid then screen:expect([[ ## grid 1 - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| + [2:-------------------]{5:│}[4:--------------------]|*5 {5:[No Name] }{4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 ^foo | bar | baz | - {0:~ }| - {0:~ }| + {0:~ }|*2 ]]) meths.input_mouse('left', 'press', '', 4, 2, 2) screen:expect([[ ## grid 1 - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| + [2:-------------------]{5:│}[4:--------------------]|*5 {5:[No Name] }{4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 foo | bar | ba^z | - {0:~ }| - {0:~ }| + {0:~ }|*2 ]]) meths.input_mouse('left', 'drag', '', 4, 1, 1) screen:expect([[ ## grid 1 - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| - [2:-------------------]{5:│}[4:--------------------]| + [2:-------------------]{5:│}[4:--------------------]|*5 {5:[No Name] }{4:[No Name] [+] }| [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 {3:-- VISUAL --} | ## grid 4 foo | b^a{27:r} | {27:baz} | - {0:~ }| - {0:~ }| + {0:~ }|*2 ]]) else screen:expect([[ {5:│}^foo | {0:~ }{5:│}bar | {0:~ }{5:│}baz | - {0:~ }{5:│}{0:~ }| - {0:~ }{5:│}{0:~ }| + {0:~ }{5:│}{0:~ }|*2 {5:[No Name] }{4:[No Name] [+] }| | ]]) @@ -8974,8 +7247,7 @@ describe('float window', function() {5:│}foo | {0:~ }{5:│}bar | {0:~ }{5:│}ba^z | - {0:~ }{5:│}{0:~ }| - {0:~ }{5:│}{0:~ }| + {0:~ }{5:│}{0:~ }|*2 {5:[No Name] }{4:[No Name] [+] }| | ]]) @@ -8985,8 +7257,7 @@ describe('float window', function() {5:│}foo | {0:~ }{5:│}b^a{27:r} | {0:~ }{5:│}{27:baz} | - {0:~ }{5:│}{0:~ }| - {0:~ }{5:│}{0:~ }| + {0:~ }{5:│}{0:~ }|*2 {5:[No Name] }{4:[No Name] [+] }| {3:-- VISUAL --} | ]]) @@ -9000,27 +7271,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 {5:┌────────────────────┐}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| + {5:│}{1: }{5:│}|*3 {5:└────────────────────┘}| ]], float_pos={ [4] = {{id = 1001}, "NW", 1, 0, 5, true, 50}; @@ -9031,9 +7291,7 @@ describe('float window', function() else screen:expect{grid=[[ ^ {5:┌────────────────────┐} | - {0:~ }{5:│}{1: }{5:│}{0: }| - {0:~ }{5:│}{1: }{5:│}{0: }| - {0:~ }{5:│}{1: }{5:│}{0: }| + {0:~ }{5:│}{1: }{5:│}{0: }|*3 {0:~ }{5:└────────────────────┘}{0: }| {0:~ }| | @@ -9066,20 +7324,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -9110,20 +7359,11 @@ describe('float window', function() meths.input_mouse('left', 'press', '', 4, 2, 1) screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -9220,14 +7460,7 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| + [2:--------------------------------------------------]|*8 [3:--------------------------------------------------]| ## grid 2 Ut enim ad minim veniam, quis nostrud | @@ -9263,14 +7496,7 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| + [2:--------------------------------------------------]|*8 [3:--------------------------------------------------]| ## grid 2 Ut enim ad minim veniam, quis nostrud | @@ -9307,14 +7533,7 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| + [2:--------------------------------------------------]|*8 [3:--------------------------------------------------]| ## grid 2 Ut enim ad minim veniam, quis nostrud | @@ -9359,14 +7578,7 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| + [2:--------------------------------------------------]|*8 [3:--------------------------------------------------]| ## grid 2 Ut enim ad minim veniam, quis nostrud | @@ -9402,14 +7614,7 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| + [2:--------------------------------------------------]|*8 [3:--------------------------------------------------]| ## grid 2 Ut enim ad minim veniam, quis nostrud | @@ -9446,14 +7651,7 @@ describe('float window', function() meths.input_mouse('wheel', 'down', '', 4, 2, 2) screen:expect{grid=[[ ## grid 1 - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| + [2:--------------------------------------------------]|*8 [3:--------------------------------------------------]| ## grid 2 Ut enim ad minim veniam, quis nostrud | @@ -9468,8 +7666,7 @@ describe('float window', function() | ## grid 4 {11:popup text}{9: }| - {12:~ }| - {12:~ }| + {12:~ }|*2 ]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}} else meths.input_mouse('wheel', 'down', '', 0, 4, 7) @@ -9495,14 +7692,7 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| - [2:--------------------------------------------------]| + [2:--------------------------------------------------]|*8 [3:--------------------------------------------------]| ## grid 2 Ut enim ad minim veniam, quis nostrud | @@ -9518,8 +7708,7 @@ describe('float window', function() ## grid 4 {17:┌}{23:Title}{17:──────────┐}| {17:│}{11:popup text}{18: }{17:│}| - {17:│}{19:~ }{17:│}| - {17:│}{19:~ }{17:│}| + {17:│}{19:~ }{17:│}|*2 {17:└}{23:Footer}{17:─────────┘}| ]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}} else @@ -9547,25 +7736,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 # TODO: 测试字典信息的准确性 | # FIXME: 测试字典信息的准确^性 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 ## grid 3 | ## grid 4 - {1:口 }| - {1:口 }| + {1:口 }|*2 {1: }| ]], float_pos={ [4] = { { id = 1001 }, "NW", 1, 0, 11, true } }} else @@ -9573,9 +7753,7 @@ describe('float window', function() # TODO: 测 {1:口 }信息的准确性 | # FIXME: 测{1:口 } 信息的准确^性 | {0:~ }{1: }{0: }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 | ]]) end @@ -9584,20 +7762,12 @@ describe('float window', function() if multigrid then screen:expect([[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| - ## grid 2 - # TODO: 测试字典信息的准确性 | - # FIXME: 测试字典信息的准确^性 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + ## grid 2 + # TODO: 测试字典信息的准确性 | + # FIXME: 测试字典信息的准确^性 | + {0:~ }|*4 ## grid 3 | ]]) @@ -9605,10 +7775,7 @@ describe('float window', function() screen:expect([[ # TODO: 测试字典信息的准确性 | # FIXME: 测试字典信息的准确^性 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 | ]]) end @@ -9629,20 +7796,12 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 # TODO: 测试字典信息的准确性 | # FIXME: 测试字典信息的准确^性 | - {3:~ }| - {3:~ }| - {3:~ }| - {3:~ }| + {3:~ }|*4 ## grid 3 | ## grid 5 @@ -9657,9 +7816,7 @@ describe('float window', function() # TODO: 测 {2: x x x}{1:息}{2: xx} 确性 | # FIXME: 测{1:试}{2:x x x}{1:息}{2: x}准确^性 | {3:~ }{4: }{3: }| - {3:~ }| - {3:~ }| - {3:~ }| + {3:~ }|*3 | ]]) end @@ -9668,20 +7825,12 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 # TODO: 测试字典信息的准确性 | # FIXME: 测试字典信息的准确^性 | - {3:~ }| - {3:~ }| - {3:~ }| - {3:~ }| + {3:~ }|*4 ## grid 3 | ## grid 5 @@ -9696,9 +7845,7 @@ describe('float window', function() # TODO: 测试{2: x x}{1:信}{2:x }{1:的}{2:xx}确性 | # FIXME: 测 {2: x x}{1:信}{2:x }{1:的}{2:x} 确^性 | {3:~ }{4: }{3: }| - {3:~ }| - {3:~ }| - {3:~ }| + {3:~ }|*3 | ]]) end @@ -9735,20 +7882,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| + {1:~ }|*5 ## grid 3 | ## grid 4 @@ -9757,10 +7895,8 @@ describe('float window', function() {2:longest}| ## grid 5 {2:---------}| - {2:- -}| - {2:- -}| - {2: }| - {2: }| + {2:- -}|*2 + {2: }|*2 ]], attr_ids={ [1] = {foreground = Screen.colors.Blue1, bold = true}; [2] = {background = Screen.colors.LightMagenta}; @@ -9803,20 +7939,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| + {1:~ }|*5 ## grid 3 | ## grid 4 @@ -9825,10 +7952,8 @@ describe('float window', function() {2:n}| ## grid 5 {2:---}| - {2:- -}| - {2:- -}| - {2: }| - {2: }| + {2:- -}|*2 + {2: }|*2 ]], attr_ids={ [1] = {foreground = Screen.colors.Blue1, bold = true}; [2] = {background = Screen.colors.LightMagenta}; @@ -9857,20 +7982,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -9888,8 +8004,7 @@ describe('float window', function() {0:~ }| {0:~ }{7: }{0: }| {0:~ }{7:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]} end @@ -9906,20 +8021,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -9962,20 +8068,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -9993,8 +8090,7 @@ describe('float window', function() {0:~ }| {0:~ }{7: }{0: }| {0:~ }{7:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]} end @@ -10011,20 +8107,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -10071,34 +8158,22 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 {7: }| - {7:~ }| - {7:~ }| + {7:~ }|*2 ## grid 5 {17: }| - {17:~ }| - {17:~ }| + {17:~ }|*2 ## grid 6 {8: }| - {8:~ }| - {8:~ }| + {8:~ }|*2 ]], float_pos={ [4] = {{id = 1001}, "NW", 1, 1, 5, true, 30}; [5] = {{id = 1002}, "NW", 1, 2, 6, true, 50}; @@ -10130,20 +8205,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -10162,8 +8228,7 @@ describe('float window', function() {0:~ }{3:floaty bar }{0: }| {0:~ }{1: }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]} end @@ -10174,28 +8239,18 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 {5:┌───────────────┐}| {5:│}{3:floaty bar }{5:│}| {5:│}{1: }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| + {5:│}{2:~ }{5:│}|*2 {5:└───────────────┘}| ]], float_pos={ [4] = {{id = 1001}, "NW", 1, 0, 4, true, 50}; @@ -10208,8 +8263,7 @@ describe('float window', function() ^ {5:┌───────────────┐} | {0:~ }{5:│}{3:floaty bar }{5:│}{0: }| {0:~ }{5:│}{1: }{5:│}{0: }| - {0:~ }{5:│}{2:~ }{5:│}{0: }| - {0:~ }{5:│}{2:~ }{5:│}{0: }| + {0:~ }{5:│}{2:~ }{5:│}{0: }|*2 {0:~ }{5:└───────────────┘}{0: }| | ]]} @@ -10225,32 +8279,14 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*9 ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*8 ## grid 3 ## grid 4 {5:┌────────────────────────────────────────┐}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| + {5:│}{1: }{5:│}|*4 {5:└────────────────────────────────────────┘}| ]], float_pos={ [4] = {{id = 1001}, "SW", 1, 9, 0, true, 50}; @@ -10261,13 +8297,9 @@ describe('float window', function() else screen:expect{grid=[[ ^ | - {0:~ }| - {0:~ }| + {0:~ }|*2 {5:┌──────────────────────────────────────┐}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| + {5:│}{1: }{5:│}|*4 {5:└──────────────────────────────────────┘}| ]]} end @@ -10281,30 +8313,14 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*9 ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*8 ## grid 3 ## grid 4 {5:┌────────────────────────────────────────┐}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| + {5:│}{1: }{5:│}|*2 {5:└────────────────────────────────────────┘}| ]], float_pos={ [4] = {{id = 1001}, "SW", 1, 9, 0, true, 50}; @@ -10315,13 +8331,9 @@ describe('float window', function() else screen:expect{grid=[[ ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*4 {5:┌──────────────────────────────────────┐}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| + {5:│}{1: }{5:│}|*2 {5:└──────────────────────────────────────┘}| ]]} @@ -10331,25 +8343,10 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*9 ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*8 ## grid 3 ]], win_viewport={ [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; @@ -10357,14 +8354,7 @@ describe('float window', function() else screen:expect{grid=[[ ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*8 ]]} end end) @@ -10377,32 +8367,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*8 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*7 ## grid 3 | ## grid 4 {5:┌────────────────────────────────────────┐}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| + {5:│}{1: }{5:│}|*4 {5:└────────────────────────────────────────┘}| ]], float_pos={ [4] = {{id = 1001}, "SW", 1, 8, 0, true, 50}; @@ -10415,10 +8389,7 @@ describe('float window', function() ^ | {0:~ }| {5:┌──────────────────────────────────────┐}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| + {5:│}{1: }{5:│}|*4 {5:└──────────────────────────────────────┘}| | ]]} @@ -10436,33 +8407,17 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [3:----------------------------------------]| - [3:----------------------------------------]| + [2:----------------------------------------]|*7 + [3:----------------------------------------]|*2 ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*7 ## grid 3 | {8:Press ENTER or type command to continue}^ | ## grid 4 {5:┌────────────────────────────────────────┐}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| + {5:│}{1: }{5:│}|*4 {5:└────────────────────────────────────────┘}| ]], float_pos={ [4] = {{id = 1001}, "SW", 1, 8, 0, true, 50}; @@ -10475,9 +8430,7 @@ describe('float window', function() | {0:~ }| {5:┌──────────────────────────────────────┐}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| + {5:│}{1: }{5:│}|*3 {4: }| | {8:Press ENTER or type command to continue}^ | @@ -10488,30 +8441,16 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*8 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*7 ## grid 3 | ## grid 4 {5:┌────────────────────────────────────────┐}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| + {5:│}{1: }{5:│}|*2 {5:└────────────────────────────────────────┘}| ]], float_pos={ [4] = {{id = 1001}, "SW", 1, 8, 0, true, 50}; @@ -10522,12 +8461,9 @@ describe('float window', function() else screen:expect{grid=[[ ^ | - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*3 {5:┌──────────────────────────────────────┐}| - {5:│}{1: }{5:│}| - {5:│}{1: }{5:│}| + {5:│}{1: }{5:│}|*2 {5:└──────────────────────────────────────┘}| | ]]} @@ -10537,24 +8473,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*8 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*7 ## grid 3 | ]], win_viewport={ @@ -10563,13 +8486,7 @@ describe('float window', function() else screen:expect{grid=[[ ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*7 | ]]} end @@ -10611,20 +8528,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 :sleep 100^ | ## grid 4 @@ -10643,8 +8551,7 @@ describe('float window', function() {0:~}{1:ab }{0: }| {0:~}{1:cd }{0: }| {0:~}{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 :sleep 100^ | ]]} end @@ -10653,20 +8560,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 :sleep 100 | ## grid 4 @@ -10685,8 +8583,7 @@ describe('float window', function() {0:~}{1:ab }{0: }| {0:~}{1:c^d }{0: }| {0:~}{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 :sleep 100 | ]]} end @@ -10698,20 +8595,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 :sleep 100^ | ## grid 4 @@ -10742,20 +8630,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 :sleep 100 | ## grid 4 @@ -10789,20 +8668,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 :sleep 100^ | ## grid 4 @@ -10833,20 +8703,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 :sleep 100 | ## grid 4 @@ -10884,20 +8745,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 @@ -10935,20 +8787,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | @@ -10959,11 +8802,7 @@ describe('float window', function() else screen:expect([[ ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 | ]]) end @@ -10972,20 +8811,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | @@ -10999,8 +8829,7 @@ describe('float window', function() {0:~ }| {0:~ }{1: }{0: }| {0:~ }{2:~ }{0: }| - {0:~ }| - {0:~ }| + {0:~ }|*2 | ]]) end @@ -11009,20 +8838,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | @@ -11033,11 +8853,7 @@ describe('float window', function() else screen:expect([[ ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 | ]]) end @@ -11065,53 +8881,27 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 {5:┌───────────┐}| {5:│}{1: }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| + {5:│}{2:~ }{5:│}|*10 {5:└───────────┘}| ## grid 5 {5:┌────────┐}| {5:│}{1: }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| + {5:│}{2:~ }{5:│}|*7 {5:└────────┘}| ## grid 6 {5:┌────┐}| {5:│}{1: }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| + {5:│}{2:~ }{5:│}|*3 {5:└────┘}| ## grid 7 {5:┌──┐}| @@ -11136,63 +8926,35 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 {5:┌───────────┐}| {5:│}{1: }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| + {5:│}{2:~ }{5:│}|*10 {5:└───────────┘}| ## grid 5 {5:┌────────┐}| {5:│}{1: }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| + {5:│}{2:~ }{5:│}|*7 {5:└────────┘}| ## grid 6 {5:┌────┐}| {5:│}{1: }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| + {5:│}{2:~ }{5:│}|*3 {5:└────┘}| ]], float_pos=expected_pos} else screen:expect([[ ^ {5:┌─┌─┌────┐─┐┐} | {0:~ }{5:│}{1: }{5:│}{1: }{5:│}{1: }{5:│}{1: }{5:││}{0: }| - {0:~ }{5:│}{2:~}{5:│}{2:~}{5:│}{2:~ }{5:│}{2: }{5:││}{0: }| - {0:~ }{5:│}{2:~}{5:│}{2:~}{5:│}{2:~ }{5:│}{2: }{5:││}{0: }| - {0:~ }{5:│}{2:~}{5:│}{2:~}{5:│}{2:~ }{5:│}{2: }{5:││}{0: }| + {0:~ }{5:│}{2:~}{5:│}{2:~}{5:│}{2:~ }{5:│}{2: }{5:││}{0: }|*3 {0:~ }{5:│}{2:~}{5:│}{2:~}{5:└────┘}{2: }{5:││}{0: }| | ]]) @@ -11203,57 +8965,30 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | ## grid 4 {5:┌───────────┐}| {5:│}{1: }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| + {5:│}{2:~ }{5:│}|*10 {5:└───────────┘}| ## grid 5 {5:┌────────┐}| {5:│}{1: }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| - {5:│}{2:~ }{5:│}| + {5:│}{2:~ }{5:│}|*7 {5:└────────┘}| ]], float_pos=expected_pos} else screen:expect([[ ^ {5:┌─┌────────┐┐} | {0:~ }{5:│}{1: }{5:│}{1: }{5:││}{0: }| - {0:~ }{5:│}{2:~}{5:│}{2:~ }{5:││}{0: }| - {0:~ }{5:│}{2:~}{5:│}{2:~ }{5:││}{0: }| - {0:~ }{5:│}{2:~}{5:│}{2:~ }{5:││}{0: }| - {0:~ }{5:│}{2:~}{5:│}{2:~ }{5:││}{0: }| + {0:~ }{5:│}{2:~}{5:│}{2:~ }{5:││}{0: }|*4 | ]]) end @@ -11262,20 +8997,11 @@ describe('float window', function() if multigrid then screen:expect{grid=[[ ## grid 1 - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| - [2:----------------------------------------]| + [2:----------------------------------------]|*6 [3:----------------------------------------]| ## grid 2 ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 ## grid 3 | @@ -11283,11 +9009,7 @@ describe('float window', function() else screen:expect([[ ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*5 | ]]) end -- cgit From d33e1da9b7f7e886219cfdd20b9bbfaccdc43be9 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 11:28:20 +0000 Subject: test: do not inject vim module into global helpers --- test/functional/ui/float_spec.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/functional/ui/float_spec.lua') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 5a78e2baa9..6febb2e2df 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -1,6 +1,5 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') -local global_helpers = require('test.helpers') local os = require('os') local clear, feed = helpers.clear, helpers.feed local assert_alive = helpers.assert_alive @@ -17,9 +16,9 @@ local curbufmeths = helpers.curbufmeths local funcs = helpers.funcs local run = helpers.run local pcall_err = helpers.pcall_err -local tbl_contains = global_helpers.tbl_contains +local tbl_contains = vim.tbl_contains local curbuf, curwin, curtab = helpers.curbuf, helpers.curwin, helpers.curtab -local NIL = helpers.NIL +local NIL = vim.NIL describe('float window', function() before_each(function() -- cgit From c30f2e3182e3b50e7c03932027ac55edfc8ada4a Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 12:44:54 +0000 Subject: test: typing for helpers.meths --- test/functional/ui/float_spec.lua | 760 +++++++++++++++++++------------------- 1 file changed, 380 insertions(+), 380 deletions(-) (limited to 'test/functional/ui/float_spec.lua') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 6febb2e2df..645cce25aa 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -30,9 +30,9 @@ describe('float window', function() -- Create three windows and test that ":wincmd " changes to the -- first window, if the previous window is invalid. command('split') - meths.open_win(0, true, {width=10, height=10, relative='editor', row=0, col=0}) + meths.nvim_open_win(0, true, {width=10, height=10, relative='editor', row=0, col=0}) eq(1002, funcs.win_getid()) - eq('editor', meths.win_get_config(1002).relative) + eq('editor', meths.nvim_win_get_config(1002).relative) command([[ call nvim_win_close(1001, v:false) wincmd j @@ -41,9 +41,9 @@ describe('float window', function() end) it('win_execute() should work' , function() - local buf = meths.create_buf(false, false) - meths.buf_set_lines(buf, 0, -1, true, {'the floatwin', 'abc', 'def'}) - local win = meths.open_win(buf, false, {relative='win', width=16, height=1, row=0, col=10}) + local buf = meths.nvim_create_buf(false, false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'the floatwin', 'abc', 'def'}) + local win = meths.nvim_open_win(buf, false, {relative='win', width=16, height=1, row=0, col=10}) local line = funcs.win_execute(win, 'echo getline(1)') eq('\nthe floatwin', line) eq('\n1', funcs.win_execute(win, 'echo line(".",'..win.id..')')) @@ -54,9 +54,9 @@ describe('float window', function() it("win_execute() call commands that are not allowed when 'hidden' is not set" , function() command('set nohidden') - local buf = meths.create_buf(false, false) - meths.buf_set_lines(buf, 0, -1, true, {'the floatwin'}) - local win = meths.open_win(buf, true, {relative='win', width=16, height=1, row=0, col=10}) + local buf = meths.nvim_create_buf(false, false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'the floatwin'}) + local win = meths.nvim_open_win(buf, true, {relative='win', width=16, height=1, row=0, col=10}) eq('Vim(close):E37: No write since last change (add ! to override)', pcall_err(funcs.win_execute, win, 'close')) eq('Vim(bdelete):E89: No write since last change for buffer 2 (add ! to override)', pcall_err(funcs.win_execute, win, 'bdelete')) funcs.win_execute(win, 'bwipe!') @@ -192,7 +192,7 @@ describe('float window', function() end) it('opened with correct position relative to the mouse', function() - meths.input_mouse('left', 'press', '', 0, 10, 10) + meths.nvim_input_mouse('left', 'press', '', 0, 10, 10) local pos = exec_lua([[ local bufnr = vim.api.nvim_create_buf(false, true) @@ -479,67 +479,67 @@ describe('float window', function() it('no crash with bufpos and non-existent window', function() command('new') - local closed_win = meths.get_current_win().id + local closed_win = meths.nvim_get_current_win().id command('close') - local buf = meths.create_buf(false,false) - meths.open_win(buf, true, {relative='win', win=closed_win, width=1, height=1, bufpos={0,0}}) + local buf = meths.nvim_create_buf(false,false) + meths.nvim_open_win(buf, true, {relative='win', win=closed_win, width=1, height=1, bufpos={0,0}}) assert_alive() end) it("no segfault when setting minimal style after clearing local 'fillchars' #19510", function() local float_opts = {relative = 'editor', row = 1, col = 1, width = 1, height = 1} - local float_win = meths.open_win(0, true, float_opts) - meths.set_option_value('fillchars', NIL, {win=float_win.id}) + local float_win = meths.nvim_open_win(0, true, float_opts) + meths.nvim_set_option_value('fillchars', NIL, {win=float_win.id}) float_opts.style = 'minimal' - meths.win_set_config(float_win, float_opts) + meths.nvim_win_set_config(float_win, float_opts) assert_alive() end) it("should re-apply 'style' when present", function() local float_opts = {style = 'minimal', relative = 'editor', row = 1, col = 1, width = 1, height = 1} - local float_win = meths.open_win(0, true, float_opts) - meths.set_option_value('number', true, { win = float_win }) + local float_win = meths.nvim_open_win(0, true, float_opts) + meths.nvim_set_option_value('number', true, { win = float_win }) float_opts.row = 2 - meths.win_set_config(float_win, float_opts) - eq(false, meths.get_option_value('number', { win = float_win })) + meths.nvim_win_set_config(float_win, float_opts) + eq(false, meths.nvim_get_option_value('number', { win = float_win })) end) it("should not re-apply 'style' when missing", function() local float_opts = {style = 'minimal', relative = 'editor', row = 1, col = 1, width = 1, height = 1} - local float_win = meths.open_win(0, true, float_opts) - meths.set_option_value('number', true, { win = float_win }) + local float_win = meths.nvim_open_win(0, true, float_opts) + meths.nvim_set_option_value('number', true, { win = float_win }) float_opts.row = 2 float_opts.style = nil - meths.win_set_config(float_win, float_opts) - eq(true, meths.get_option_value('number', { win = float_win })) + meths.nvim_win_set_config(float_win, float_opts) + eq(true, meths.nvim_get_option_value('number', { win = float_win })) end) it("'scroll' is computed correctly when opening float with splitkeep=screen #20684", function() - meths.set_option_value('splitkeep', 'screen', {}) + meths.nvim_set_option_value('splitkeep', 'screen', {}) local float_opts = {relative = 'editor', row = 1, col = 1, width = 10, height = 10} - local float_win = meths.open_win(0, true, float_opts) - eq(5, meths.get_option_value('scroll', {win=float_win.id})) + local float_win = meths.nvim_open_win(0, true, float_opts) + eq(5, meths.nvim_get_option_value('scroll', {win=float_win.id})) end) it(':unhide works when there are floating windows', function() local float_opts = {relative = 'editor', row = 1, col = 1, width = 5, height = 5} local w0 = curwin() - meths.open_win(0, false, float_opts) - meths.open_win(0, false, float_opts) - eq(3, #meths.list_wins()) + meths.nvim_open_win(0, false, float_opts) + meths.nvim_open_win(0, false, float_opts) + eq(3, #meths.nvim_list_wins()) command('unhide') - eq({ w0 }, meths.list_wins()) + eq({ w0 }, meths.nvim_list_wins()) end) it(':all works when there are floating windows', function() command('args Xa.txt') local float_opts = {relative = 'editor', row = 1, col = 1, width = 5, height = 5} local w0 = curwin() - meths.open_win(0, false, float_opts) - meths.open_win(0, false, float_opts) - eq(3, #meths.list_wins()) + meths.nvim_open_win(0, false, float_opts) + meths.nvim_open_win(0, false, float_opts) + eq(3, #meths.nvim_list_wins()) command('all') - eq({ w0 }, meths.list_wins()) + eq({ w0 }, meths.nvim_list_wins()) end) describe('with only one tabpage,', function() @@ -552,37 +552,37 @@ describe('float window', function() end) describe('closing the last non-floating window gives E444', function() before_each(function() - meths.open_win(old_buf, true, float_opts) + meths.nvim_open_win(old_buf, true, float_opts) end) it('if called from non-floating window', function() - meths.set_current_win(old_win) + meths.nvim_set_current_win(old_win) eq('Vim:E444: Cannot close last window', - pcall_err(meths.win_close, old_win, false)) + pcall_err(meths.nvim_win_close, old_win, false)) end) it('if called from floating window', function() eq('Vim:E444: Cannot close last window', - pcall_err(meths.win_close, old_win, false)) + pcall_err(meths.nvim_win_close, old_win, false)) end) end) describe("deleting the last non-floating window's buffer", function() describe('leaves one window with an empty buffer when there is only one buffer', function() local same_buf_float before_each(function() - same_buf_float = meths.open_win(old_buf, false, float_opts).id + same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id end) after_each(function() eq(old_win, curwin().id) expect('') - eq(1, #meths.list_wins()) + eq(1, #meths.nvim_list_wins()) end) it('if called from non-floating window', function() - meths.buf_delete(old_buf, {force = true}) + meths.nvim_buf_delete(old_buf, {force = true}) end) it('if called from floating window', function() - meths.set_current_win(same_buf_float) + meths.nvim_set_current_win(same_buf_float) command('autocmd WinLeave * let g:win_leave = nvim_get_current_win()') command('autocmd WinEnter * let g:win_enter = nvim_get_current_win()') - meths.buf_delete(old_buf, {force = true}) + meths.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, eval('g:win_leave')) eq(old_win, eval('g:win_enter')) end) @@ -590,67 +590,67 @@ describe('float window', function() describe('closes other windows with that buffer when there are other buffers', function() local same_buf_float, other_buf, other_buf_float before_each(function() - same_buf_float = meths.open_win(old_buf, false, float_opts).id - other_buf = meths.create_buf(true, false).id - other_buf_float = meths.open_win(other_buf, true, float_opts).id + same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id + other_buf = meths.nvim_create_buf(true, false).id + other_buf_float = meths.nvim_open_win(other_buf, true, float_opts).id insert('bar') - meths.set_current_win(old_win) + meths.nvim_set_current_win(old_win) end) after_each(function() eq(other_buf, curbuf().id) expect('bar') - eq(2, #meths.list_wins()) + eq(2, #meths.nvim_list_wins()) end) it('if called from non-floating window', function() - meths.buf_delete(old_buf, {force = true}) + meths.nvim_buf_delete(old_buf, {force = true}) eq(old_win, curwin().id) end) it('if called from floating window with the same buffer', function() - meths.set_current_win(same_buf_float) + meths.nvim_set_current_win(same_buf_float) command('autocmd WinLeave * let g:win_leave = nvim_get_current_win()') command('autocmd WinEnter * let g:win_enter = nvim_get_current_win()') - meths.buf_delete(old_buf, {force = true}) + meths.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, eval('g:win_leave')) eq(old_win, eval('g:win_enter')) eq(old_win, curwin().id) end) -- TODO: this case is too hard to deal with pending('if called from floating window with another buffer', function() - meths.set_current_win(other_buf_float) - meths.buf_delete(old_buf, {force = true}) + meths.nvim_set_current_win(other_buf_float) + meths.nvim_buf_delete(old_buf, {force = true}) end) end) describe('creates an empty buffer when there is only one listed buffer', function() local same_buf_float, unlisted_buf_float before_each(function() - same_buf_float = meths.open_win(old_buf, false, float_opts).id - local unlisted_buf = meths.create_buf(true, false).id - unlisted_buf_float = meths.open_win(unlisted_buf, true, float_opts).id + same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id + local unlisted_buf = meths.nvim_create_buf(true, false).id + unlisted_buf_float = meths.nvim_open_win(unlisted_buf, true, float_opts).id insert('unlisted') command('set nobuflisted') - meths.set_current_win(old_win) + meths.nvim_set_current_win(old_win) end) after_each(function() expect('') - eq(2, #meths.list_wins()) + eq(2, #meths.nvim_list_wins()) end) it('if called from non-floating window', function() - meths.buf_delete(old_buf, {force = true}) + meths.nvim_buf_delete(old_buf, {force = true}) eq(old_win, curwin().id) end) it('if called from floating window with the same buffer', function() - meths.set_current_win(same_buf_float) + meths.nvim_set_current_win(same_buf_float) command('autocmd WinLeave * let g:win_leave = nvim_get_current_win()') command('autocmd WinEnter * let g:win_enter = nvim_get_current_win()') - meths.buf_delete(old_buf, {force = true}) + meths.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, eval('g:win_leave')) eq(old_win, eval('g:win_enter')) eq(old_win, curwin().id) end) -- TODO: this case is too hard to deal with pending('if called from floating window with an unlisted buffer', function() - meths.set_current_win(unlisted_buf_float) - meths.buf_delete(old_buf, {force = true}) + meths.nvim_set_current_win(unlisted_buf_float) + meths.nvim_buf_delete(old_buf, {force = true}) end) end) end) @@ -661,20 +661,20 @@ describe('float window', function() command('botright vnew') insert('unlisted') command('set nobuflisted') - meths.set_current_win(old_win) - same_buf_float = meths.open_win(old_buf, false, float_opts).id + meths.nvim_set_current_win(old_win) + same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id end) after_each(function() expect('') - eq(2, #meths.list_wins()) + eq(2, #meths.nvim_list_wins()) end) it('if called from non-floating window with the deleted buffer', function() - meths.buf_delete(old_buf, {force = true}) + meths.nvim_buf_delete(old_buf, {force = true}) eq(old_win, curwin().id) end) it('if called from floating window with the deleted buffer', function() - meths.set_current_win(same_buf_float) - meths.buf_delete(old_buf, {force = true}) + meths.nvim_set_current_win(same_buf_float) + meths.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, curwin().id) end) end) @@ -696,28 +696,28 @@ describe('float window', function() describe('without splits, deleting the last listed buffer creates an empty buffer', function() local same_buf_float before_each(function() - meths.set_current_win(old_win) - same_buf_float = meths.open_win(old_buf, false, float_opts).id + meths.nvim_set_current_win(old_win) + same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id end) after_each(function() expect('') - eq(2, #meths.list_wins()) - eq(2, #meths.list_tabpages()) + eq(2, #meths.nvim_list_wins()) + eq(2, #meths.nvim_list_tabpages()) end) it('if called from non-floating window', function() - meths.buf_delete(old_buf, {force = true}) + meths.nvim_buf_delete(old_buf, {force = true}) eq(old_win, curwin().id) end) it('if called from non-floating window in another tabpage', function() command('tab split') - eq(3, #meths.list_tabpages()) - meths.buf_delete(old_buf, {force = true}) + eq(3, #meths.nvim_list_tabpages()) + meths.nvim_buf_delete(old_buf, {force = true}) end) it('if called from floating window with the same buffer', function() - meths.set_current_win(same_buf_float) + meths.nvim_set_current_win(same_buf_float) command('autocmd WinLeave * let g:win_leave = nvim_get_current_win()') command('autocmd WinEnter * let g:win_enter = nvim_get_current_win()') - meths.buf_delete(old_buf, {force = true}) + meths.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, eval('g:win_leave')) eq(old_win, eval('g:win_enter')) eq(old_win, curwin().id) @@ -727,22 +727,22 @@ describe('float window', function() local same_buf_float before_each(function() command('botright vsplit') - meths.set_current_buf(unlisted_buf) - meths.set_current_win(old_win) - same_buf_float = meths.open_win(old_buf, false, float_opts).id + meths.nvim_set_current_buf(unlisted_buf) + meths.nvim_set_current_win(old_win) + same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id end) after_each(function() expect('') - eq(3, #meths.list_wins()) - eq(2, #meths.list_tabpages()) + eq(3, #meths.nvim_list_wins()) + eq(2, #meths.nvim_list_tabpages()) end) it('if called from non-floating window with the deleted buffer', function() - meths.buf_delete(old_buf, {force = true}) + meths.nvim_buf_delete(old_buf, {force = true}) eq(old_win, curwin().id) end) it('if called from floating window with the deleted buffer', function() - meths.set_current_win(same_buf_float) - meths.buf_delete(old_buf, {force = true}) + meths.nvim_set_current_win(same_buf_float) + meths.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, curwin().id) end) end) @@ -762,38 +762,38 @@ describe('float window', function() describe('closes the tabpage when all floating windows are closeable', function() local same_buf_float before_each(function() - same_buf_float = meths.open_win(old_buf, false, float_opts).id + same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id end) after_each(function() eq(old_tabpage, curtab().id) expect('oldtab') - eq(1, #meths.list_tabpages()) + eq(1, #meths.nvim_list_tabpages()) end) it('if called from non-floating window', function() - meths.win_close(old_win, false) + meths.nvim_win_close(old_win, false) end) it('if called from floating window', function() - meths.set_current_win(same_buf_float) - meths.win_close(old_win, false) + meths.nvim_set_current_win(same_buf_float) + meths.nvim_win_close(old_win, false) end) end) describe('gives E5601 when there are non-closeable floating windows', function() local other_buf_float before_each(function() command('set nohidden') - local other_buf = meths.create_buf(true, false).id - other_buf_float = meths.open_win(other_buf, true, float_opts).id + local other_buf = meths.nvim_create_buf(true, false).id + other_buf_float = meths.nvim_open_win(other_buf, true, float_opts).id insert('foo') - meths.set_current_win(old_win) + meths.nvim_set_current_win(old_win) end) it('if called from non-floating window', function() eq('Vim:E5601: Cannot close window, only floating window would remain', - pcall_err(meths.win_close, old_win, false)) + pcall_err(meths.nvim_win_close, old_win, false)) end) it('if called from floating window', function() - meths.set_current_win(other_buf_float) + meths.nvim_set_current_win(other_buf_float) eq('Vim:E5601: Cannot close window, only floating window would remain', - pcall_err(meths.win_close, old_win, false)) + pcall_err(meths.nvim_win_close, old_win, false)) end) end) end) @@ -801,27 +801,27 @@ describe('float window', function() describe('closes the tabpage when all floating windows are closeable', function() local same_buf_float, other_buf, other_buf_float before_each(function() - same_buf_float = meths.open_win(old_buf, false, float_opts).id - other_buf = meths.create_buf(true, false).id - other_buf_float = meths.open_win(other_buf, true, float_opts).id - meths.set_current_win(old_win) + same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id + other_buf = meths.nvim_create_buf(true, false).id + other_buf_float = meths.nvim_open_win(other_buf, true, float_opts).id + meths.nvim_set_current_win(old_win) end) after_each(function() eq(old_tabpage, curtab().id) expect('oldtab') - eq(1, #meths.list_tabpages()) + eq(1, #meths.nvim_list_tabpages()) end) it('if called from non-floating window', function() - meths.buf_delete(old_buf, {force = false}) + meths.nvim_buf_delete(old_buf, {force = false}) end) it('if called from floating window with the same buffer', function() - meths.set_current_win(same_buf_float) - meths.buf_delete(old_buf, {force = false}) + meths.nvim_set_current_win(same_buf_float) + meths.nvim_buf_delete(old_buf, {force = false}) end) -- TODO: this case is too hard to deal with pending('if called from floating window with another buffer', function() - meths.set_current_win(other_buf_float) - meths.buf_delete(old_buf, {force = false}) + meths.nvim_set_current_win(other_buf_float) + meths.nvim_buf_delete(old_buf, {force = false}) end) end) -- TODO: what to do when there are non-closeable floating windows? @@ -868,8 +868,8 @@ describe('float window', function() end) it('can be created and reconfigured', 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 buf = meths.nvim_create_buf(false,false) + local win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) local expected_pos = { [4]={{id=1001}, 'NW', 1, 2, 5, true}, } @@ -900,7 +900,7 @@ describe('float window', function() end - meths.win_set_config(win, {relative='editor', row=0, col=10}) + meths.nvim_win_set_config(win, {relative='editor', row=0, col=10}) expected_pos[4][4] = 0 expected_pos[4][5] = 10 if multigrid then @@ -926,7 +926,7 @@ describe('float window', function() ]]) end - meths.win_close(win, false) + meths.nvim_win_close(win, false) if multigrid then screen:expect([[ ## grid 1 @@ -949,8 +949,8 @@ describe('float window', function() it('window position fixed', function() command('rightbelow 20vsplit') - local buf = meths.create_buf(false,false) - local win = meths.open_win(buf, false, { + local buf = meths.nvim_create_buf(false,false) + local win = meths.nvim_open_win(buf, false, { relative='win', width=15, height=2, row=2, col=10, anchor='NW', fixed=true}) if multigrid then @@ -985,7 +985,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {fixed=false}) + meths.nvim_win_set_config(win, {fixed=false}) if multigrid then screen:expect_unchanged() @@ -1009,8 +1009,8 @@ describe('float window', function() -- or something. command("set redrawdebug=compositor") command("set wd=1") - 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 buf = meths.nvim_create_buf(false,false) + local win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) local expected_pos = { [4]={{id=1001}, 'NW', 1, 2, 5, true}, } @@ -1041,7 +1041,7 @@ describe('float window', function() end - meths.win_set_config(win, {relative='editor', row=0, col=10}) + meths.nvim_win_set_config(win, {relative='editor', row=0, col=10}) expected_pos[4][4] = 0 expected_pos[4][5] = 10 if multigrid then @@ -1067,7 +1067,7 @@ describe('float window', function() ]]) end - meths.win_close(win, false) + meths.nvim_win_close(win, false) if multigrid then screen:expect([[ ## grid 1 @@ -1089,16 +1089,16 @@ describe('float window', function() end) it('return their configuration', function() - local buf = meths.create_buf(false, false) - local win = meths.open_win(buf, false, {relative='editor', width=20, height=2, row=3, col=5, zindex=60}) + local buf = meths.nvim_create_buf(false, false) + local win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=3, col=5, zindex=60}) local expected = {anchor='NW', col=5, external=false, focusable=true, height=2, relative='editor', row=3, width=20, zindex=60, hide=false} - eq(expected, meths.win_get_config(win)) + eq(expected, meths.nvim_win_get_config(win)) - eq({relative='', external=false, focusable=true, hide=false}, meths.win_get_config(0)) + eq({relative='', external=false, focusable=true, hide=false}, meths.nvim_win_get_config(0)) if multigrid then - meths.win_set_config(win, {external=true, width=10, height=1}) - eq({external=true,focusable=true,width=10,height=1,relative='',hide=false}, meths.win_get_config(win)) + meths.nvim_win_set_config(win, {external=true, width=10, height=1}) + eq({external=true,focusable=true,width=10,height=1,relative='',hide=false}, meths.nvim_win_get_config(win)) end end) @@ -1106,7 +1106,7 @@ describe('float window', function() command('set number') command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ixygg') - local win = meths.open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10}) + local win = meths.nvim_open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1137,8 +1137,8 @@ describe('float window', function() ]]) end - local buf = meths.create_buf(false, true) - meths.win_set_buf(win, buf) + local buf = meths.nvim_create_buf(false, true) + meths.nvim_win_set_buf(win, buf) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1174,7 +1174,7 @@ describe('float window', function() command('set foldcolumn=1') command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ixygg') - local win = meths.open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) + local win = meths.nvim_open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1238,8 +1238,8 @@ describe('float window', function() end command('sign unplace 1 buffer=1') - local buf = meths.create_buf(false, true) - meths.win_set_buf(win, buf) + local buf = meths.nvim_create_buf(false, true) + meths.nvim_win_set_buf(win, buf) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1274,7 +1274,7 @@ describe('float window', function() command('set foldcolumn=1') command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ixygg') - local win = meths.open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) + local win = meths.nvim_open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1338,8 +1338,8 @@ describe('float window', function() end command('sign unplace 1 buffer=1') - local buf = meths.create_buf(false, true) - meths.win_set_buf(win, buf) + local buf = meths.nvim_create_buf(false, true) + meths.nvim_win_set_buf(win, buf) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1375,7 +1375,7 @@ describe('float window', function() command('set statuscolumn=%l%s%C') command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ixygg') - meths.open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) + meths.nvim_open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1406,10 +1406,10 @@ describe('float window', function() end) it('can have border', function() - local buf = meths.create_buf(false, false) - meths.buf_set_lines(buf, 0, -1, true, {' halloj! ', + local buf = meths.nvim_create_buf(false, false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', ' BORDAA '}) - local win = meths.open_win(buf, false, {relative='editor', width=9, height=2, row=2, col=5, border="double"}) + local win = meths.nvim_open_win(buf, false, {relative='editor', width=9, height=2, row=2, col=5, border="double"}) if multigrid then screen:expect{grid=[[ @@ -1444,7 +1444,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {border="single"}) + meths.nvim_win_set_config(win, {border="single"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1478,7 +1478,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {border="rounded"}) + meths.nvim_win_set_config(win, {border="rounded"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1512,7 +1512,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {border="solid"}) + meths.nvim_win_set_config(win, {border="solid"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1547,7 +1547,7 @@ describe('float window', function() end -- support: ascii char, UTF-8 char, composed char, highlight per char - meths.win_set_config(win, {border={"x", {"å", "ErrorMsg"}, {"\\"}, {"n̈̊", "Search"}}}) + meths.nvim_win_set_config(win, {border={"x", {"å", "ErrorMsg"}, {"\\"}, {"n̈̊", "Search"}}}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1581,7 +1581,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {border="none"}) + meths.nvim_win_set_config(win, {border="none"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1612,7 +1612,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {border={"", "", "", ">", "", "", "", "<"}}) + meths.nvim_win_set_config(win, {border={"", "", "", ">", "", "", "", "<"}}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1643,7 +1643,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {border={"", "_", "", "", "", "-", "", ""}}) + meths.nvim_win_set_config(win, {border={"", "_", "", "", "", "-", "", ""}}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1685,7 +1685,7 @@ describe('float window', function() of border shadow ]] - meths.win_set_config(win, {border="shadow"}) + meths.nvim_win_set_config(win, {border="shadow"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1724,13 +1724,13 @@ describe('float window', function() end) it('validates title title_pos', function() - local buf = meths.create_buf(false,false) + local buf = meths.nvim_create_buf(false,false) eq("title requires border to be set", - pcall_err(meths.open_win,buf, false, { + pcall_err(meths.nvim_open_win,buf, false, { relative='editor', width=9, height=2, row=2, col=5, title='Title', })) eq("title_pos requires title to be set", - pcall_err(meths.open_win,buf, false, { + pcall_err(meths.nvim_open_win,buf, false, { relative='editor', width=9, height=2, row=2, col=5, border='single', title_pos='left', })) @@ -1758,13 +1758,13 @@ describe('float window', function() end) it('validates footer footer_pos', function() - local buf = meths.create_buf(false,false) + local buf = meths.nvim_create_buf(false,false) eq("footer requires border to be set", - pcall_err(meths.open_win,buf, false, { + pcall_err(meths.nvim_open_win,buf, false, { relative='editor', width=9, height=2, row=2, col=5, footer='Footer', })) eq("footer_pos requires footer to be set", - pcall_err(meths.open_win,buf, false, { + pcall_err(meths.nvim_open_win,buf, false, { relative='editor', width=9, height=2, row=2, col=5, border='single', footer_pos='left', })) @@ -1792,10 +1792,10 @@ describe('float window', function() end) it('center aligned title longer than window width #25746', function() - local buf = meths.create_buf(false, false) - meths.buf_set_lines(buf, 0, -1, true, {' halloj! ', + local buf = meths.nvim_create_buf(false, false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', ' BORDAA '}) - local win = meths.open_win(buf, false, { + local win = meths.nvim_open_win(buf, false, { relative='editor', width=9, height=2, row=2, col=5, border="double", title = "abcdefghijklmnopqrstuvwxyz",title_pos = "center", }) @@ -1833,15 +1833,15 @@ describe('float window', function() ]]} end - meths.win_close(win, false) + meths.nvim_win_close(win, false) assert_alive() end) it('border with title', function() - local buf = meths.create_buf(false, false) - meths.buf_set_lines(buf, 0, -1, true, {' halloj! ', + local buf = meths.nvim_create_buf(false, false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', ' BORDAA '}) - local win = meths.open_win(buf, false, { + local win = meths.nvim_open_win(buf, false, { relative='editor', width=9, height=2, row=2, col=5, border="double", title = "Left",title_pos = "left", }) @@ -1879,7 +1879,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {title= "Center",title_pos="center"}) + meths.nvim_win_set_config(win, {title= "Center",title_pos="center"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1913,7 +1913,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {title= "Right",title_pos="right"}) + meths.nvim_win_set_config(win, {title= "Right",title_pos="right"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1947,7 +1947,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {title= { {"🦄"},{"BB"}},title_pos="right"}) + meths.nvim_win_set_config(win, {title= { {"🦄"},{"BB"}},title_pos="right"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1983,10 +1983,10 @@ describe('float window', function() end) it('border with footer', function() - local buf = meths.create_buf(false, false) - meths.buf_set_lines(buf, 0, -1, true, {' halloj! ', + local buf = meths.nvim_create_buf(false, false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', ' BORDAA '}) - local win = meths.open_win(buf, false, { + local win = meths.nvim_open_win(buf, false, { relative='editor', width=9, height=2, row=2, col=5, border="double", footer = "Left",footer_pos = "left", }) @@ -2024,7 +2024,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {footer= "Center",footer_pos="center"}) + meths.nvim_win_set_config(win, {footer= "Center",footer_pos="center"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2058,7 +2058,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {footer= "Right",footer_pos="right"}) + meths.nvim_win_set_config(win, {footer= "Right",footer_pos="right"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2092,7 +2092,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {footer= { {"🦄"},{"BB"}},footer_pos="right"}) + meths.nvim_win_set_config(win, {footer= { {"🦄"},{"BB"}},footer_pos="right"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2128,10 +2128,10 @@ describe('float window', function() end) it('border with title and footer', function() - local buf = meths.create_buf(false, false) - meths.buf_set_lines(buf, 0, -1, true, {' halloj! ', + local buf = meths.nvim_create_buf(false, false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', ' BORDAA '}) - local win = meths.open_win(buf, false, { + local win = meths.nvim_open_win(buf, false, { relative='editor', width=9, height=2, row=2, col=5, border="double", title = "Left", title_pos = "left", footer = "Right", footer_pos = "right", }) @@ -2169,7 +2169,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {title= "Center",title_pos="center",footer= "Center",footer_pos="center"}) + meths.nvim_win_set_config(win, {title= "Center",title_pos="center",footer= "Center",footer_pos="center"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2203,7 +2203,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {title= "Right",title_pos="right",footer= "Left",footer_pos="left"}) + meths.nvim_win_set_config(win, {title= "Right",title_pos="right",footer= "Left",footer_pos="left"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2239,7 +2239,7 @@ describe('float window', function() command('hi B0 guibg=Red guifg=Black') command('hi B1 guifg=White') - meths.win_set_config(win, { + meths.nvim_win_set_config(win, { title = {{"🦄"}, {"BB", {"B0", "B1"}}}, title_pos = "right", footer= {{"🦄"}, {"BB", {"B0", "B1"}}}, footer_pos = "right", }) @@ -2278,8 +2278,8 @@ describe('float window', function() end) it('terminates border on edge of viewport when window extends past viewport', function() - local buf = meths.create_buf(false, false) - meths.open_win(buf, false, {relative='editor', width=40, height=7, row=0, col=0, border="single", zindex=201}) + local buf = meths.nvim_create_buf(false, false) + meths.nvim_open_win(buf, false, {relative='editor', width=40, height=7, row=0, col=0, border="single", zindex=201}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2313,10 +2313,10 @@ describe('float window', function() it('with border show popupmenu', function() screen:try_resize(40,10) - local buf = meths.create_buf(false, false) - meths.buf_set_lines(buf, 0, -1, true, {'aaa aab ', + local buf = meths.nvim_create_buf(false, false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'aaa aab ', 'abb acc ', ''}) - meths.open_win(buf, true, {relative='editor', width=9, height=3, row=0, col=5, border="double"}) + meths.nvim_open_win(buf, true, {relative='editor', width=9, height=3, row=0, col=5, border="double"}) feed 'G' if multigrid then @@ -2482,10 +2482,10 @@ describe('float window', function() it('show ruler of current floating window', function() command 'set ruler' - local buf = meths.create_buf(false, false) - meths.buf_set_lines(buf, 0, -1, true, {'aaa aab ', + local buf = meths.nvim_create_buf(false, false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'aaa aab ', 'abb acc '}) - meths.open_win(buf, true, {relative='editor', width=9, height=3, row=0, col=5}) + meths.nvim_open_win(buf, true, {relative='editor', width=9, height=3, row=0, col=5}) feed 'gg' if multigrid then @@ -2552,7 +2552,7 @@ describe('float window', function() it("correct ruler position in current float with 'rulerformat' set", function() command 'set ruler rulerformat=fish:<><' - meths.open_win(0, true, {relative='editor', width=9, height=3, row=0, col=5}) + meths.nvim_open_win(0, true, {relative='editor', width=9, height=3, row=0, col=5}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2585,10 +2585,10 @@ describe('float window', function() it('does not show ruler of not-last current float during ins-completion', function() screen:try_resize(50,9) command 'set ruler showmode' - meths.open_win(0, false, {relative='editor', width=3, height=3, row=0, col=0}) - meths.open_win(0, false, {relative='editor', width=3, height=3, row=0, col=5}) + meths.nvim_open_win(0, false, {relative='editor', width=3, height=3, row=0, col=0}) + meths.nvim_open_win(0, false, {relative='editor', width=3, height=3, row=0, col=5}) feed 'w' - neq('', meths.win_get_config(0).relative) + neq('', meths.nvim_win_get_config(0).relative) neq(funcs.winnr '$', funcs.winnr()) if multigrid then screen:expect{grid=[[ @@ -2659,9 +2659,9 @@ describe('float window', function() it('can have minimum size', function() insert("the background text") - local buf = meths.create_buf(false, true) - meths.buf_set_lines(buf, 0, -1, true, {'x'}) - local win = meths.open_win(buf, false, {relative='win', width=1, height=1, row=0, col=4, focusable=false}) + local buf = meths.nvim_create_buf(false, true) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'x'}) + local win = meths.nvim_open_win(buf, false, {relative='win', width=1, height=1, row=0, col=4, focusable=false}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2685,7 +2685,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {relative='win', row=0, col=15}) + meths.nvim_win_set_config(win, {relative='win', row=0, col=15}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2709,7 +2709,7 @@ describe('float window', function() ]]) end - meths.win_close(win,false) + meths.nvim_win_close(win,false) if multigrid then screen:expect([[ ## grid 1 @@ -2745,8 +2745,8 @@ describe('float window', function() command('sargument 6') local float_opts = { relative = 'editor', row = 6, col = 0, width = 40, height = 1 } - meths.win_set_config(w3, float_opts) - meths.win_set_config(w4, float_opts) + meths.nvim_win_set_config(w3, float_opts) + meths.nvim_win_set_config(w4, float_opts) command('wincmd =') if multigrid then screen:expect{grid=[[ @@ -2875,36 +2875,36 @@ describe('float window', function() end) it('API has proper error messages', function() - local buf = meths.create_buf(false,false) + local buf = meths.nvim_create_buf(false,false) eq("Invalid key: 'bork'", - pcall_err(meths.open_win,buf, false, {width=20,height=2,bork=true})) + pcall_err(meths.nvim_open_win,buf, false, {width=20,height=2,bork=true})) eq("'win' key is only valid with relative='win'", - pcall_err(meths.open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,win=0})) + pcall_err(meths.nvim_open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,win=0})) eq("Only one of 'relative' and 'external' must be used", - pcall_err(meths.open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,external=true})) + pcall_err(meths.nvim_open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,external=true})) eq("Invalid value of 'relative' key", - pcall_err(meths.open_win,buf, false, {width=20,height=2,relative='shell',row=0,col=0})) + pcall_err(meths.nvim_open_win,buf, false, {width=20,height=2,relative='shell',row=0,col=0})) eq("Invalid value of 'anchor' key", - pcall_err(meths.open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,anchor='bottom'})) + pcall_err(meths.nvim_open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,anchor='bottom'})) eq("'relative' requires 'row'/'col' or 'bufpos'", - pcall_err(meths.open_win,buf, false, {width=20,height=2,relative='editor'})) + pcall_err(meths.nvim_open_win,buf, false, {width=20,height=2,relative='editor'})) eq("'width' key must be a positive Integer", - pcall_err(meths.open_win,buf, false, {width=-1,height=2,relative='editor', row=0, col=0})) + pcall_err(meths.nvim_open_win,buf, false, {width=-1,height=2,relative='editor', row=0, col=0})) eq("'height' key must be a positive Integer", - pcall_err(meths.open_win,buf, false, {width=20,height=-1,relative='editor', row=0, col=0})) + pcall_err(meths.nvim_open_win,buf, false, {width=20,height=-1,relative='editor', row=0, col=0})) eq("'height' key must be a positive Integer", - pcall_err(meths.open_win,buf, false, {width=20,height=0,relative='editor', row=0, col=0})) + pcall_err(meths.nvim_open_win,buf, false, {width=20,height=0,relative='editor', row=0, col=0})) eq("Must specify 'width'", - pcall_err(meths.open_win,buf, false, {relative='editor', row=0, col=0})) + pcall_err(meths.nvim_open_win,buf, false, {relative='editor', row=0, col=0})) eq("Must specify 'height'", - pcall_err(meths.open_win,buf, false, {relative='editor', row=0, col=0, width=2})) + pcall_err(meths.nvim_open_win,buf, false, {relative='editor', row=0, col=0, width=2})) end) it('can be placed relative window or cursor', function() screen:try_resize(40,9) - meths.buf_set_lines(0, 0, -1, true, {'just some', 'example text'}) + meths.nvim_buf_set_lines(0, 0, -1, true, {'just some', 'example text'}) feed('gge') - local oldwin = meths.get_current_win() + local oldwin = meths.nvim_get_current_win() command('below split') if multigrid then screen:expect([[ @@ -2939,9 +2939,9 @@ describe('float window', function() ]]) end - local buf = meths.create_buf(false,false) + local buf = meths.nvim_create_buf(false,false) -- no 'win' arg, relative default window - local win = meths.open_win(buf, false, {relative='win', width=20, height=2, row=0, col=10}) + local win = meths.nvim_open_win(buf, false, {relative='win', width=20, height=2, row=0, col=10}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2980,7 +2980,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {relative='cursor', row=1, col=-2}) + meths.nvim_win_set_config(win, {relative='cursor', row=1, col=-2}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3019,7 +3019,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {relative='cursor', row=0, col=0, anchor='SW'}) + meths.nvim_win_set_config(win, {relative='cursor', row=0, col=0, anchor='SW'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3058,7 +3058,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {relative='win', win=oldwin, row=1, col=10, anchor='NW'}) + meths.nvim_win_set_config(win, {relative='win', win=oldwin, row=1, col=10, anchor='NW'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3097,7 +3097,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {relative='win', win=oldwin, row=3, col=39, anchor='SE'}) + meths.nvim_win_set_config(win, {relative='win', win=oldwin, row=3, col=39, anchor='SE'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3136,7 +3136,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {relative='win', win=0, row=0, col=50, anchor='NE'}) + meths.nvim_win_set_config(win, {relative='win', win=0, row=0, col=50, anchor='NE'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3206,7 +3206,7 @@ describe('float window', function() it('always anchor to corner including border', function() screen:try_resize(40,13) - meths.buf_set_lines(0, 0, -1, true, {'just some example text', 'some more example text'}) + meths.nvim_buf_set_lines(0, 0, -1, true, {'just some example text', 'some more example text'}) feed('ggeee') command('below split') if multigrid then @@ -3242,10 +3242,10 @@ describe('float window', function() ]]) end - local buf = meths.create_buf(false, false) - meths.buf_set_lines(buf, 0, -1, true, {' halloj! ', + local buf = meths.nvim_create_buf(false, false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', ' BORDAA '}) - local win = meths.open_win(buf, false, {relative='cursor', width=9, height=2, row=1, col=-2, border="double"}) + local win = meths.nvim_open_win(buf, false, {relative='cursor', width=9, height=2, row=1, col=-2, border="double"}) if multigrid then screen:expect{grid=[[ @@ -3289,7 +3289,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {relative='cursor', row=0, col=-2, anchor='NE'}) + meths.nvim_win_set_config(win, {relative='cursor', row=0, col=-2, anchor='NE'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3332,7 +3332,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {relative='cursor', row=1, col=-2, anchor='SE'}) + meths.nvim_win_set_config(win, {relative='cursor', row=1, col=-2, anchor='SE'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3375,7 +3375,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {relative='cursor', row=0, col=-2, anchor='SW'}) + meths.nvim_win_set_config(win, {relative='cursor', row=0, col=-2, anchor='SW'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3595,8 +3595,8 @@ describe('float window', function() it('can be placed relative text in a window', function() screen:try_resize(30,5) - local firstwin = meths.get_current_win().id - meths.buf_set_lines(0, 0, -1, true, {'just some', 'example text that is wider than the window', '', '', 'more text'}) + local firstwin = meths.nvim_get_current_win().id + meths.nvim_buf_set_lines(0, 0, -1, true, {'just some', 'example text that is wider than the window', '', '', 'more text'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3619,10 +3619,10 @@ describe('float window', function() ]]} end - local buf = meths.create_buf(false,false) - meths.buf_set_lines(buf, 0, -1, true, {'some info!'}) + local buf = meths.nvim_create_buf(false,false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'some info!'}) - local win = meths.open_win(buf, false, {relative='win', width=12, height=1, bufpos={1,32}}) + local win = meths.nvim_open_win(buf, false, {relative='win', width=12, height=1, bufpos={1,32}}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3650,7 +3650,7 @@ describe('float window', function() ]]} end eq({relative='win', width=12, height=1, bufpos={1,32}, anchor='NW', hide=false, - external=false, col=0, row=1, win=firstwin, focusable=true, zindex=50}, meths.win_get_config(win)) + external=false, col=0, row=1, win=firstwin, focusable=true, zindex=50}, meths.nvim_win_get_config(win)) feed('') if multigrid then @@ -3738,7 +3738,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {relative='win', bufpos={1,32}, anchor='SW'}) + meths.nvim_win_set_config(win, {relative='win', bufpos={1,32}, anchor='SW'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3811,7 +3811,7 @@ describe('float window', function() end command('close') - meths.win_set_config(win, {relative='win', bufpos={1,32}, anchor='NW', col=-2}) + meths.nvim_win_set_config(win, {relative='win', bufpos={1,32}, anchor='NW', col=-2}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3842,7 +3842,7 @@ describe('float window', function() ]]} end - meths.win_set_config(win, {relative='win', bufpos={1,32}, row=2}) + meths.nvim_win_set_config(win, {relative='win', bufpos={1,32}, row=2}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3923,9 +3923,9 @@ describe('float window', function() ]]) end - local buf = meths.create_buf(false,true) - meths.buf_set_lines(buf, 0, -1, true, {'some floaty text'}) - meths.open_win(buf, false, {relative='editor', width=20, height=1, row=3, col=1}) + local buf = meths.nvim_create_buf(false,true) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'some floaty text'}) + meths.nvim_open_win(buf, false, {relative='editor', width=20, height=1, row=3, col=1}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3958,8 +3958,8 @@ describe('float window', function() local screen2 = Screen.new(40,7) screen2:attach(nil, session2) screen2:set_default_attr_ids(attrs) - local buf = meths.create_buf(false,false) - meths.open_win(buf, true, {relative='editor', width=20, height=2, row=2, col=5}) + local buf = meths.nvim_create_buf(false,false) + meths.nvim_open_win(buf, true, {relative='editor', width=20, height=2, row=2, col=5}) local expected_pos = { [2]={{id=1001}, 'NW', 1, 2, 5} } @@ -3985,9 +3985,9 @@ describe('float window', function() it('handles resized screen', function() - local buf = meths.create_buf(false,false) - 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 buf = meths.nvim_create_buf(false,false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'such', 'very', 'float'}) + local win = meths.nvim_open_win(buf, false, {relative='editor', width=15, height=4, row=2, col=10}) local expected_pos = { [4]={{id=1001}, 'NW', 1, 2, 10, true}, } @@ -4150,7 +4150,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {height=3}) + meths.nvim_win_set_config(win, {height=3}) feed('gg') if multigrid then screen:expect{grid=[[ @@ -4435,8 +4435,8 @@ describe('float window', function() command("set inccommand=split") command("set laststatus=2") - local buf = meths.create_buf(false,false) - meths.open_win(buf, true, {relative='editor', width=30, height=3, row=2, col=0}) + local buf = meths.nvim_create_buf(false,false) + meths.nvim_open_win(buf, true, {relative='editor', width=30, height=3, row=2, col=0}) insert([[ foo @@ -4532,17 +4532,17 @@ describe('float window', function() end) it('does not crash when set cmdheight #9680', function() - local buf = meths.create_buf(false,false) - meths.open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) + local buf = meths.nvim_create_buf(false,false) + meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) command("set cmdheight=2") - eq(1, meths.eval('1')) + eq(1, meths.nvim_eval('1')) end) describe('and completion', function() before_each(function() - local buf = meths.create_buf(false,false) - local win = meths.open_win(buf, true, {relative='editor', width=12, height=4, row=2, col=5}).id - meths.set_option_value('winhl', 'Normal:ErrorMsg', {win=win}) + local buf = meths.nvim_create_buf(false,false) + local win = meths.nvim_open_win(buf, true, {relative='editor', width=12, height=4, row=2, col=5}).id + meths.nvim_set_option_value('winhl', 'Normal:ErrorMsg', {win=win}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -4890,9 +4890,9 @@ describe('float window', function() ]]) end - local buf = meths.create_buf(false,true) - meths.buf_set_lines(buf,0,-1,true,{"some info", "about item"}) - win = meths.open_win(buf, false, {relative='cursor', width=12, height=2, row=1, col=10}) + local buf = meths.nvim_create_buf(false,true) + meths.nvim_buf_set_lines(buf,0,-1,true,{"some info", "about item"}) + win = meths.nvim_open_win(buf, false, {relative='cursor', width=12, height=2, row=1, col=10}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -4954,7 +4954,7 @@ describe('float window', function() ]]) end - meths.win_close(win, false) + meths.nvim_win_close(win, false) if multigrid then screen:expect([[ ## grid 1 @@ -4976,7 +4976,7 @@ describe('float window', function() end) it('and close float first', function() - meths.win_close(win, false) + meths.nvim_win_close(win, false) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -5028,10 +5028,10 @@ describe('float window', function() end) it("can use Normal as background", function() - local buf = meths.create_buf(false,false) - meths.buf_set_lines(buf,0,-1,true,{"here", "float"}) - local win = meths.open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) - meths.set_option_value('winhl', 'Normal:Normal', {win=win}) + local buf = meths.nvim_create_buf(false,false) + meths.nvim_buf_set_lines(buf,0,-1,true,{"here", "float"}) + local win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) + meths.nvim_set_option_value('winhl', 'Normal:Normal', {win=win}) if multigrid then screen:expect{grid=[[ @@ -5071,10 +5071,10 @@ describe('float window', function() -- the default, but be explicit: command("set laststatus=1") command("set hidden") - meths.buf_set_lines(0,0,-1,true,{"x"}) - local buf = meths.create_buf(false,false) - 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"}) + meths.nvim_buf_set_lines(0,0,-1,true,{"x"}) + local buf = meths.nvim_create_buf(false,false) + win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) + meths.nvim_buf_set_lines(buf,0,-1,true,{"y"}) expected_pos = { [4]={{id=1001}, 'NW', 1, 2, 5, true} } @@ -5159,7 +5159,7 @@ describe('float window', function() end) it("w with focusable=false", function() - meths.win_set_config(win, {focusable=false}) + meths.nvim_win_set_config(win, {focusable=false}) expected_pos[4][6] = false feed("wi") -- i to provoke redraw if multigrid then @@ -5270,7 +5270,7 @@ describe('float window', function() it("focus by mouse", function() if multigrid then - meths.input_mouse('left', 'press', '', 4, 0, 0) + meths.nvim_input_mouse('left', 'press', '', 4, 0, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -5285,7 +5285,7 @@ describe('float window', function() {2:~ }| ]], float_pos=expected_pos} else - meths.input_mouse('left', 'press', '', 0, 2, 5) + meths.nvim_input_mouse('left', 'press', '', 0, 2, 5) screen:expect([[ x | {0:~ }| @@ -5297,7 +5297,7 @@ describe('float window', function() end if multigrid then - meths.input_mouse('left', 'press', '', 2, 0, 0) + meths.nvim_input_mouse('left', 'press', '', 2, 0, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -5312,7 +5312,7 @@ describe('float window', function() {2:~ }| ]], float_pos=expected_pos} else - meths.input_mouse('left', 'press', '', 0, 0, 0) + meths.nvim_input_mouse('left', 'press', '', 0, 0, 0) screen:expect([[ ^x | {0:~ }| @@ -5325,11 +5325,11 @@ describe('float window', function() end) it("focus by mouse (focusable=false)", function() - meths.win_set_config(win, {focusable=false}) - meths.buf_set_lines(0, -1, -1, true, {"a"}) + meths.nvim_win_set_config(win, {focusable=false}) + meths.nvim_buf_set_lines(0, -1, -1, true, {"a"}) expected_pos[4][6] = false if multigrid then - meths.input_mouse('left', 'press', '', 4, 0, 0) + meths.nvim_input_mouse('left', 'press', '', 4, 0, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -5345,7 +5345,7 @@ describe('float window', function() {2:~ }| ]], float_pos=expected_pos} else - meths.input_mouse('left', 'press', '', 0, 2, 5) + meths.nvim_input_mouse('left', 'press', '', 0, 2, 5) screen:expect([[ x | ^a | @@ -5357,7 +5357,7 @@ describe('float window', function() end if multigrid then - meths.input_mouse('left', 'press', '', 2, 0, 0) + meths.nvim_input_mouse('left', 'press', '', 2, 0, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -5373,7 +5373,7 @@ describe('float window', function() {2:~ }| ]], float_pos=expected_pos, unchanged=true} else - meths.input_mouse('left', 'press', '', 0, 0, 0) + meths.nvim_input_mouse('left', 'press', '', 0, 0, 0) screen:expect([[ ^x | a | @@ -6155,7 +6155,7 @@ describe('float window', function() -- enter first float feed('') -- enter second float - meths.open_win(0, true, {relative='editor', width=20, height=2, row=4, col=8}) + meths.nvim_open_win(0, true, {relative='editor', width=20, height=2, row=4, col=8}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -6475,7 +6475,7 @@ describe('float window', function() end if multigrid then - meths.win_set_config(0, {external=true, width=30, height=2}) + meths.nvim_win_set_config(0, {external=true, width=30, height=2}) expected_pos = {[4]={external=true}} screen:expect{grid=[[ ## grid 1 @@ -6493,7 +6493,7 @@ describe('float window', function() ]], float_pos=expected_pos} else eq("UI doesn't support external windows", - pcall_err(meths.win_set_config, 0, {external=true, width=30, height=2})) + pcall_err(meths.nvim_win_set_config, 0, {external=true, width=30, height=2})) return end @@ -6519,7 +6519,7 @@ describe('float window', function() end) it('J (float with border)', function() - meths.win_set_config(win, {relative='editor', width=20, height=2, row=2, col=5, border='single'}) + meths.nvim_win_set_config(win, {relative='editor', width=20, height=2, row=2, col=5, border='single'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -6791,7 +6791,7 @@ describe('float window', function() it(":tabnew and :tabnext (external)", function() if multigrid then -- also test external window wider than main screen - meths.win_set_config(win, {external=true, width=65, height=4}) + meths.nvim_win_set_config(win, {external=true, width=65, height=4}) expected_pos = {[4]={external=true}} feed(":tabnew") screen:expect{grid=[[ @@ -6813,7 +6813,7 @@ describe('float window', function() ]], float_pos=expected_pos} else eq("UI doesn't support external windows", - pcall_err(meths.win_set_config, 0, {external=true, width=65, height=4})) + pcall_err(meths.nvim_win_set_config, 0, {external=true, width=65, height=4})) end feed(":tabnext") @@ -6861,9 +6861,9 @@ describe('float window', function() end) it("left drag changes visual selection in float window", function() - local buf = meths.create_buf(false,false) - meths.buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) - meths.open_win(buf, false, {relative='editor', width=20, height=3, row=2, col=5}) + local buf = meths.nvim_create_buf(false,false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) + meths.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=2, col=5}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -6885,7 +6885,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} - meths.input_mouse('left', 'press', '', 4, 0, 0) + meths.nvim_input_mouse('left', 'press', '', 4, 0, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -6906,7 +6906,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} - meths.input_mouse('left', 'drag', '', 4, 1, 2) + meths.nvim_input_mouse('left', 'drag', '', 4, 1, 2) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -6937,7 +6937,7 @@ describe('float window', function() | ]]} - meths.input_mouse('left', 'press', '', 0, 2, 5) + meths.nvim_input_mouse('left', 'press', '', 0, 2, 5) screen:expect{grid=[[ | {0:~ }| @@ -6948,7 +6948,7 @@ describe('float window', function() | ]]} - meths.input_mouse('left', 'drag', '', 0, 3, 7) + meths.nvim_input_mouse('left', 'drag', '', 0, 3, 7) screen:expect{grid=[[ | {0:~ }| @@ -6962,9 +6962,9 @@ describe('float window', function() end) it("left drag changes visual selection in float window with border", function() - local buf = meths.create_buf(false,false) - meths.buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) - meths.open_win(buf, false, {relative='editor', width=20, height=3, row=0, col=5, border='single'}) + local buf = meths.nvim_create_buf(false,false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) + meths.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=0, col=5, border='single'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -6988,7 +6988,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} - meths.input_mouse('left', 'press', '', 4, 1, 1) + meths.nvim_input_mouse('left', 'press', '', 4, 1, 1) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -7011,7 +7011,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} - meths.input_mouse('left', 'drag', '', 4, 2, 3) + meths.nvim_input_mouse('left', 'drag', '', 4, 2, 3) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -7044,7 +7044,7 @@ describe('float window', function() | ]]} - meths.input_mouse('left', 'press', '', 0, 1, 6) + meths.nvim_input_mouse('left', 'press', '', 0, 1, 6) screen:expect{grid=[[ {5:┌────────────────────┐} | {0:~ }{5:│}{1:^foo }{5:│}{0: }| @@ -7055,7 +7055,7 @@ describe('float window', function() | ]]} - meths.input_mouse('left', 'drag', '', 0, 2, 8) + meths.nvim_input_mouse('left', 'drag', '', 0, 2, 8) screen:expect{grid=[[ {5:┌────────────────────┐} | {0:~ }{5:│}{27:foo}{1: }{5:│}{0: }| @@ -7069,10 +7069,10 @@ describe('float window', function() end) it("left drag changes visual selection in float window with winbar", function() - local buf = meths.create_buf(false,false) - meths.buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) - local float_win = meths.open_win(buf, false, {relative='editor', width=20, height=4, row=1, col=5}) - meths.set_option_value('winbar', 'floaty bar', {win=float_win.id}) + local buf = meths.nvim_create_buf(false,false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) + local float_win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=4, row=1, col=5}) + meths.nvim_set_option_value('winbar', 'floaty bar', {win=float_win.id}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7095,7 +7095,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} - meths.input_mouse('left', 'press', '', 4, 1, 0) + meths.nvim_input_mouse('left', 'press', '', 4, 1, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -7117,7 +7117,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} - meths.input_mouse('left', 'drag', '', 4, 2, 2) + meths.nvim_input_mouse('left', 'drag', '', 4, 2, 2) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -7149,7 +7149,7 @@ describe('float window', function() | ]]} - meths.input_mouse('left', 'press', '', 0, 2, 5) + meths.nvim_input_mouse('left', 'press', '', 0, 2, 5) screen:expect{grid=[[ | {0:~ }{3:floaty bar }{0: }| @@ -7160,7 +7160,7 @@ describe('float window', function() | ]]} - meths.input_mouse('left', 'drag', '', 0, 3, 7) + meths.nvim_input_mouse('left', 'drag', '', 0, 3, 7) screen:expect{grid=[[ | {0:~ }{3:floaty bar }{0: }| @@ -7174,9 +7174,9 @@ describe('float window', function() end) it('left drag changes visual selection if float window is turned into a split', function() - local buf = meths.create_buf(false,false) - meths.buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) - meths.open_win(buf, true, {relative='editor', width=20, height=3, row=2, col=5}) + local buf = meths.nvim_create_buf(false,false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) + meths.nvim_open_win(buf, true, {relative='editor', width=20, height=3, row=2, col=5}) command('wincmd L') if multigrid then screen:expect([[ @@ -7196,7 +7196,7 @@ describe('float window', function() {0:~ }|*2 ]]) - meths.input_mouse('left', 'press', '', 4, 2, 2) + meths.nvim_input_mouse('left', 'press', '', 4, 2, 2) screen:expect([[ ## grid 1 [2:-------------------]{5:│}[4:--------------------]|*5 @@ -7214,7 +7214,7 @@ describe('float window', function() {0:~ }|*2 ]]) - meths.input_mouse('left', 'drag', '', 4, 1, 1) + meths.nvim_input_mouse('left', 'drag', '', 4, 1, 1) screen:expect([[ ## grid 1 [2:-------------------]{5:│}[4:--------------------]|*5 @@ -7241,7 +7241,7 @@ describe('float window', function() | ]]) - meths.input_mouse('left', 'press', '', 0, 2, 22) + meths.nvim_input_mouse('left', 'press', '', 0, 2, 22) screen:expect([[ {5:│}foo | {0:~ }{5:│}bar | @@ -7251,7 +7251,7 @@ describe('float window', function() | ]]) - meths.input_mouse('left', 'drag', '', 0, 1, 21) + meths.nvim_input_mouse('left', 'drag', '', 0, 1, 21) screen:expect([[ {5:│}foo | {0:~ }{5:│}b^a{27:r} | @@ -7264,9 +7264,9 @@ describe('float window', function() end) it('left click sets correct curswant in float window with border', function() - local buf = meths.create_buf(false,false) - meths.buf_set_lines(buf, 0, -1, true, {'', '', ''}) - meths.open_win(buf, false, {relative='editor', width=20, height=3, row=0, col=5, border='single'}) + local buf = meths.nvim_create_buf(false,false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'', '', ''}) + meths.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=0, col=5, border='single'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7298,23 +7298,23 @@ describe('float window', function() end if multigrid then - meths.input_mouse('left', 'press', '', 4, 3, 1) + meths.nvim_input_mouse('left', 'press', '', 4, 3, 1) else - meths.input_mouse('left', 'press', '', 0, 3, 6) + meths.nvim_input_mouse('left', 'press', '', 0, 3, 6) end eq({0, 3, 1, 0, 1}, funcs.getcurpos()) if multigrid then - meths.input_mouse('left', 'press', '', 4, 3, 2) + meths.nvim_input_mouse('left', 'press', '', 4, 3, 2) else - meths.input_mouse('left', 'press', '', 0, 3, 7) + meths.nvim_input_mouse('left', 'press', '', 0, 3, 7) end eq({0, 3, 1, 0, 2}, funcs.getcurpos()) if multigrid then - meths.input_mouse('left', 'press', '', 4, 3, 10) + meths.nvim_input_mouse('left', 'press', '', 4, 3, 10) else - meths.input_mouse('left', 'press', '', 0, 3, 15) + meths.nvim_input_mouse('left', 'press', '', 0, 3, 15) end eq({0, 3, 1, 0, 10}, funcs.getcurpos()) @@ -7355,7 +7355,7 @@ describe('float window', function() end if multigrid then - meths.input_mouse('left', 'press', '', 4, 2, 1) + meths.nvim_input_mouse('left', 'press', '', 4, 2, 1) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -7378,7 +7378,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} else - meths.input_mouse('left', 'press', '', 0, 2, 6) + meths.nvim_input_mouse('left', 'press', '', 0, 2, 6) screen:expect{grid=[[ {5:┌────────────────────┐} | {0:~ }{5:│}{19: }{1:^ }{5:│}{0: }| @@ -7391,23 +7391,23 @@ describe('float window', function() end if multigrid then - meths.input_mouse('left', 'press', '', 4, 2, 2) + meths.nvim_input_mouse('left', 'press', '', 4, 2, 2) else - meths.input_mouse('left', 'press', '', 0, 2, 7) + meths.nvim_input_mouse('left', 'press', '', 0, 2, 7) end eq({0, 2, 1, 0, 1}, funcs.getcurpos()) if multigrid then - meths.input_mouse('left', 'press', '', 4, 2, 3) + meths.nvim_input_mouse('left', 'press', '', 4, 2, 3) else - meths.input_mouse('left', 'press', '', 0, 2, 8) + meths.nvim_input_mouse('left', 'press', '', 0, 2, 8) end eq({0, 2, 1, 0, 2}, funcs.getcurpos()) if multigrid then - meths.input_mouse('left', 'press', '', 4, 2, 11) + meths.nvim_input_mouse('left', 'press', '', 4, 2, 11) else - meths.input_mouse('left', 'press', '', 0, 2, 16) + meths.nvim_input_mouse('left', 'press', '', 0, 2, 16) end eq({0, 2, 1, 0, 10}, funcs.getcurpos()) end) @@ -7453,9 +7453,9 @@ describe('float window', function() occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]) - local buf = meths.create_buf(false,false) - meths.buf_set_lines(buf, 0, -1, true, {"test", "", "popup text"}) - local win = meths.open_win(buf, false, {relative='editor', width=15, height=3, row=2, col=5}) + local buf = meths.nvim_create_buf(false,false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {"test", "", "popup text"}) + local win = meths.nvim_open_win(buf, false, {relative='editor', width=15, height=3, row=2, col=5}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7491,7 +7491,7 @@ describe('float window', function() ]]) end - meths.set_option_value("winblend", 30, {win=win.id}) + meths.nvim_set_option_value("winblend", 30, {win=win.id}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7528,7 +7528,7 @@ describe('float window', function() end -- Check that 'winblend' works with NormalNC highlight - meths.set_option_value('winhighlight', 'NormalNC:Visual', {win = win}) + meths.nvim_set_option_value('winhighlight', 'NormalNC:Visual', {win = win}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7573,7 +7573,7 @@ describe('float window', function() command('hi clear NormalNC') command('hi SpecialRegion guifg=Red blend=0') - meths.buf_add_highlight(buf, -1, "SpecialRegion", 2, 0, -1) + meths.nvim_buf_add_highlight(buf, -1, "SpecialRegion", 2, 0, -1) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7647,7 +7647,7 @@ describe('float window', function() -- Test scrolling by mouse if multigrid then - meths.input_mouse('wheel', 'down', '', 4, 2, 2) + meths.nvim_input_mouse('wheel', 'down', '', 4, 2, 2) screen:expect{grid=[[ ## grid 1 [2:--------------------------------------------------]|*8 @@ -7668,7 +7668,7 @@ describe('float window', function() {12:~ }|*2 ]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}} else - meths.input_mouse('wheel', 'down', '', 0, 4, 7) + meths.nvim_input_mouse('wheel', 'down', '', 0, 4, 7) screen:expect([[ Ut enim ad minim veniam, quis nostrud | exercitation ullamco laboris nisi ut aliquip ex | @@ -7683,9 +7683,9 @@ describe('float window', function() end -- Check that 'winblend' applies to border/title/footer - meths.win_set_config(win, {border='single', title='Title', footer='Footer'}) - meths.set_option_value('winblend', 100, {win=win.id}) - meths.set_option_value("cursorline", true, {win=0}) + meths.nvim_win_set_config(win, {border='single', title='Title', footer='Footer'}) + meths.nvim_set_option_value('winblend', 100, {win=win.id}) + meths.nvim_set_option_value("cursorline", true, {win=0}) command('hi clear VertSplit') feed('k0') if multigrid then @@ -7729,9 +7729,9 @@ describe('float window', function() insert([[ # TODO: 测试字典信息的准确性 # FIXME: 测试字典信息的准确性]]) - local buf = meths.create_buf(false,false) - meths.buf_set_lines(buf, 0, -1, true, {'口', '口'}) - local win = meths.open_win(buf, false, {relative='editor', width=5, height=3, row=0, col=11, style='minimal'}) + local buf = meths.nvim_create_buf(false,false) + meths.nvim_buf_set_lines(buf, 0, -1, true, {'口', '口'}) + local win = meths.nvim_open_win(buf, false, {relative='editor', width=5, height=3, row=0, col=11, style='minimal'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7757,7 +7757,7 @@ describe('float window', function() ]]) end - meths.win_close(win, false) + meths.nvim_win_close(win, false) if multigrid then screen:expect([[ ## grid 1 @@ -7782,9 +7782,9 @@ describe('float window', function() -- The interaction between 'winblend' and doublewidth chars in the background -- does not look very good. But check no chars get incorrectly placed -- at least. Also check invisible EndOfBuffer region blends correctly. - meths.buf_set_lines(buf, 0, -1, true, {" x x x xx", " x x x x"}) - win = meths.open_win(buf, false, {relative='editor', width=12, height=3, row=0, col=11, style='minimal'}) - meths.set_option_value('winblend', 30, {win=win.id}) + meths.nvim_buf_set_lines(buf, 0, -1, true, {" x x x xx", " x x x x"}) + win = meths.nvim_open_win(buf, false, {relative='editor', width=12, height=3, row=0, col=11, style='minimal'}) + meths.nvim_set_option_value('winblend', 30, {win=win.id}) screen:set_default_attr_ids({ [1] = {foreground = tonumber('0xb282b2'), background = tonumber('0xffcfff')}, [2] = {foreground = Screen.colors.Grey0, background = tonumber('0xffcfff')}, @@ -7820,7 +7820,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {relative='editor', row=0, col=12}) + meths.nvim_win_set_config(win, {relative='editor', row=0, col=12}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7974,9 +7974,9 @@ describe('float window', function() end) it("correctly orders multiple opened floats (current last)", 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}) - meths.set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win.id}) + local buf = meths.nvim_create_buf(false,false) + local win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) + meths.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win.id}) if multigrid then screen:expect{grid=[[ @@ -8060,9 +8060,9 @@ describe('float window', function() end) it("correctly orders multiple opened floats (non-current last)", 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}) - meths.set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win.id}) + local buf = meths.nvim_create_buf(false,false) + local win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) + meths.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win.id}) if multigrid then screen:expect{grid=[[ @@ -8146,13 +8146,13 @@ describe('float window', function() end) it('can use z-index', function() - local buf = meths.create_buf(false,false) - local win1 = meths.open_win(buf, false, {relative='editor', width=20, height=3, row=1, col=5, zindex=30}) - meths.set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win1.id}) - local win2 = meths.open_win(buf, false, {relative='editor', width=20, height=3, row=2, col=6, zindex=50}) - meths.set_option_value("winhl", "Normal:Search,EndOfBuffer:Search", {win=win2.id}) - local win3 = meths.open_win(buf, false, {relative='editor', width=20, height=3, row=3, col=7, zindex=40}) - meths.set_option_value("winhl", "Normal:Question,EndOfBuffer:Question", {win=win3.id}) + local buf = meths.nvim_create_buf(false,false) + local win1 = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=1, col=5, zindex=30}) + meths.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win1.id}) + local win2 = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=2, col=6, zindex=50}) + meths.nvim_set_option_value("winhl", "Normal:Search,EndOfBuffer:Search", {win=win2.id}) + local win3 = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=3, col=7, zindex=40}) + meths.nvim_set_option_value("winhl", "Normal:Question,EndOfBuffer:Question", {win=win3.id}) if multigrid then screen:expect{grid=[[ @@ -8197,9 +8197,9 @@ describe('float window', function() end) it('can use winbar', function() - local buf = meths.create_buf(false,false) - local win1 = meths.open_win(buf, false, {relative='editor', width=15, height=3, row=1, col=5}) - meths.set_option_value('winbar', 'floaty bar', {win=win1.id}) + local buf = meths.nvim_create_buf(false,false) + local win1 = meths.nvim_open_win(buf, false, {relative='editor', width=15, height=3, row=1, col=5}) + meths.nvim_set_option_value('winbar', 'floaty bar', {win=win1.id}) if multigrid then screen:expect{grid=[[ @@ -8233,7 +8233,7 @@ describe('float window', function() end -- resize and add a border - meths.win_set_config(win1, {relative='editor', width=15, height=4, row=0, col=4, border = 'single'}) + meths.nvim_win_set_config(win1, {relative='editor', width=15, height=4, row=0, col=4, border = 'single'}) if multigrid then screen:expect{grid=[[ @@ -8272,8 +8272,8 @@ describe('float window', function() it('it can be resized with messages and cmdheight=0 #20106', function() screen:try_resize(40,9) command 'set cmdheight=0' - local buf = meths.create_buf(false,true) - local win = meths.open_win(buf, false, {relative='editor', width=40, height=4, anchor='SW', row=9, col=0, style='minimal', border="single", noautocmd=true}) + local buf = meths.nvim_create_buf(false,true) + local win = meths.nvim_open_win(buf, false, {relative='editor', width=40, height=4, anchor='SW', row=9, col=0, style='minimal', border="single", noautocmd=true}) if multigrid then screen:expect{grid=[[ @@ -8338,7 +8338,7 @@ describe('float window', function() end - meths.win_close(win, true) + meths.nvim_win_close(win, true) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -8360,8 +8360,8 @@ describe('float window', function() it('it can be resized with messages and cmdheight=1', function() screen:try_resize(40,9) - local buf = meths.create_buf(false,true) - local win = meths.open_win(buf, false, {relative='editor', width=40, height=4, anchor='SW', row=8, col=0, style='minimal', border="single", noautocmd=true}) + local buf = meths.nvim_create_buf(false,true) + local win = meths.nvim_open_win(buf, false, {relative='editor', width=40, height=4, anchor='SW', row=8, col=0, style='minimal', border="single", noautocmd=true}) if multigrid then screen:expect{grid=[[ @@ -8468,7 +8468,7 @@ describe('float window', function() ]]} end - meths.win_close(win, true) + meths.nvim_win_close(win, true) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -8494,7 +8494,7 @@ describe('float window', function() describe('no crash after moving and closing float window #21547', function() local function test_float_move_close(cmd) local float_opts = {relative = 'editor', row = 1, col = 1, width = 10, height = 10} - meths.open_win(meths.create_buf(false, false), true, float_opts) + meths.nvim_open_win(meths.nvim_create_buf(false, false), true, float_opts) if multigrid then screen:expect({float_pos = {[4] = {{id = 1001}, 'NW', 1, 1, 1, true}}}) end @@ -8521,7 +8521,7 @@ describe('float window', function() it(':sleep cursor placement #22639', function() local float_opts = {relative = 'editor', row = 1, col = 1, width = 4, height = 3} - local win = meths.open_win(meths.create_buf(false, false), true, float_opts) + local win = meths.nvim_open_win(meths.nvim_create_buf(false, false), true, float_opts) feed('iabcd') feed(':sleep 100') if multigrid then @@ -8589,7 +8589,7 @@ describe('float window', function() feed('') screen:expect_unchanged() - meths.win_set_config(win, {border = 'single'}) + meths.nvim_win_set_config(win, {border = 'single'}) feed(':sleep 100') if multigrid then screen:expect{grid=[[ @@ -8738,7 +8738,7 @@ describe('float window', function() it('with rightleft and border #22640', function() local float_opts = {relative='editor', width=5, height=3, row=1, col=1, border='single'} - meths.open_win(meths.create_buf(false, false), true, float_opts) + meths.nvim_open_win(meths.nvim_create_buf(false, false), true, float_opts) command('setlocal rightleft') feed('iabcdef') if multigrid then @@ -8777,8 +8777,8 @@ describe('float window', function() end) it('float window with hide option', function() - local buf = meths.create_buf(false,false) - local win = meths.open_win(buf, false, {relative='editor', width=10, height=2, row=2, col=5, hide = true}) + local buf = meths.nvim_create_buf(false,false) + local win = meths.nvim_open_win(buf, false, {relative='editor', width=10, height=2, row=2, col=5, hide = true}) local expected_pos = { [4]={{id=1001}, 'NW', 1, 2, 5, true}, } @@ -8806,7 +8806,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {hide = false}) + meths.nvim_win_set_config(win, {hide = false}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -8833,7 +8833,7 @@ describe('float window', function() ]]) end - meths.win_set_config(win, {hide=true}) + meths.nvim_win_set_config(win, {hide=true}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -8859,18 +8859,18 @@ describe('float window', function() end) it(':fclose command #9663', function() - local buf_a = meths.create_buf(false,false) - local buf_b = meths.create_buf(false,false) - local buf_c = meths.create_buf(false,false) - local buf_d = meths.create_buf(false,false) + local buf_a = meths.nvim_create_buf(false,false) + local buf_b = meths.nvim_create_buf(false,false) + local buf_c = meths.nvim_create_buf(false,false) + local buf_d = meths.nvim_create_buf(false,false) local config_a = {relative='editor', width=11, height=11, row=5, col=5, border ='single', zindex=50} local config_b = {relative='editor', width=8, height=8, row=7, col=7, border ='single', zindex=70} local config_c = {relative='editor', width=4, height=4, row=9, col=9, border ='single',zindex=90} local config_d = {relative='editor', width=2, height=2, row=10, col=10, border ='single',zindex=100} - meths.open_win(buf_a, false, config_a) - meths.open_win(buf_b, false, config_b) - meths.open_win(buf_c, false, config_c) - meths.open_win(buf_d, false, config_d) + meths.nvim_open_win(buf_a, false, config_a) + meths.nvim_open_win(buf_b, false, config_b) + meths.nvim_open_win(buf_c, false, config_c) + meths.nvim_open_win(buf_d, false, config_d) local expected_pos = { [4]={{id=1001}, 'NW', 1, 5, 5, true, 50}, [5]={{id=1002}, 'NW', 1, 7, 7, true, 70}, -- cgit From 4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 13:11:28 +0000 Subject: test: normalise nvim bridge functions - remove helpers.cur*meths - remove helpers.nvim --- test/functional/ui/float_spec.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/functional/ui/float_spec.lua') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 645cce25aa..944e40876f 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -12,12 +12,13 @@ local exec = helpers.exec local exec_lua = helpers.exec_lua local insert = helpers.insert local meths = helpers.meths -local curbufmeths = helpers.curbufmeths local funcs = helpers.funcs local run = helpers.run local pcall_err = helpers.pcall_err local tbl_contains = vim.tbl_contains -local curbuf, curwin, curtab = helpers.curbuf, helpers.curwin, helpers.curtab +local curbuf = helpers.meths.nvim_get_current_buf +local curwin = helpers.meths.nvim_get_current_win +local curtab = helpers.meths.nvim_get_current_tabpage local NIL = vim.NIL describe('float window', function() @@ -6624,7 +6625,7 @@ describe('float window', function() for i = 1,5 do feed(i.."w") feed_command("enew") - curbufmeths.set_lines(0,-1,true,{tostring(i)}) + meths.nvim_buf_set_lines(0, 0,-1,true,{tostring(i)}) end if multigrid then -- cgit From 795f896a5772d5e0795f86642bdf90c82efac45c Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 17:59:57 +0000 Subject: test: rename (meths, funcs) -> (api, fn) --- test/functional/ui/float_spec.lua | 820 +++++++++++++++++++------------------- 1 file changed, 410 insertions(+), 410 deletions(-) (limited to 'test/functional/ui/float_spec.lua') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 944e40876f..d08e346fc2 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -11,14 +11,14 @@ local expect = helpers.expect local exec = helpers.exec local exec_lua = helpers.exec_lua local insert = helpers.insert -local meths = helpers.meths -local funcs = helpers.funcs +local api = helpers.api +local fn = helpers.fn local run = helpers.run local pcall_err = helpers.pcall_err local tbl_contains = vim.tbl_contains -local curbuf = helpers.meths.nvim_get_current_buf -local curwin = helpers.meths.nvim_get_current_win -local curtab = helpers.meths.nvim_get_current_tabpage +local curbuf = helpers.api.nvim_get_current_buf +local curwin = helpers.api.nvim_get_current_win +local curtab = helpers.api.nvim_get_current_tabpage local NIL = vim.NIL describe('float window', function() @@ -31,36 +31,36 @@ describe('float window', function() -- Create three windows and test that ":wincmd " changes to the -- first window, if the previous window is invalid. command('split') - meths.nvim_open_win(0, true, {width=10, height=10, relative='editor', row=0, col=0}) - eq(1002, funcs.win_getid()) - eq('editor', meths.nvim_win_get_config(1002).relative) + api.nvim_open_win(0, true, {width=10, height=10, relative='editor', row=0, col=0}) + eq(1002, fn.win_getid()) + eq('editor', api.nvim_win_get_config(1002).relative) command([[ call nvim_win_close(1001, v:false) wincmd j ]]) - eq(1000, funcs.win_getid()) + eq(1000, fn.win_getid()) end) it('win_execute() should work' , function() - local buf = meths.nvim_create_buf(false, false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'the floatwin', 'abc', 'def'}) - local win = meths.nvim_open_win(buf, false, {relative='win', width=16, height=1, row=0, col=10}) - local line = funcs.win_execute(win, 'echo getline(1)') + local buf = api.nvim_create_buf(false, false) + api.nvim_buf_set_lines(buf, 0, -1, true, {'the floatwin', 'abc', 'def'}) + local win = api.nvim_open_win(buf, false, {relative='win', width=16, height=1, row=0, col=10}) + local line = fn.win_execute(win, 'echo getline(1)') eq('\nthe floatwin', line) - eq('\n1', funcs.win_execute(win, 'echo line(".",'..win.id..')')) - eq('\n3', funcs.win_execute(win, 'echo line("$",'..win.id..')')) - eq('\n0', funcs.win_execute(win, 'echo line("$", 123456)')) - funcs.win_execute(win, 'bwipe!') + eq('\n1', fn.win_execute(win, 'echo line(".",'..win.id..')')) + eq('\n3', fn.win_execute(win, 'echo line("$",'..win.id..')')) + eq('\n0', fn.win_execute(win, 'echo line("$", 123456)')) + fn.win_execute(win, 'bwipe!') end) it("win_execute() call commands that are not allowed when 'hidden' is not set" , function() command('set nohidden') - local buf = meths.nvim_create_buf(false, false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'the floatwin'}) - local win = meths.nvim_open_win(buf, true, {relative='win', width=16, height=1, row=0, col=10}) - eq('Vim(close):E37: No write since last change (add ! to override)', pcall_err(funcs.win_execute, win, 'close')) - eq('Vim(bdelete):E89: No write since last change for buffer 2 (add ! to override)', pcall_err(funcs.win_execute, win, 'bdelete')) - funcs.win_execute(win, 'bwipe!') + local buf = api.nvim_create_buf(false, false) + api.nvim_buf_set_lines(buf, 0, -1, true, {'the floatwin'}) + local win = api.nvim_open_win(buf, true, {relative='win', width=16, height=1, row=0, col=10}) + eq('Vim(close):E37: No write since last change (add ! to override)', pcall_err(fn.win_execute, win, 'close')) + eq('Vim(bdelete):E89: No write since last change for buffer 2 (add ! to override)', pcall_err(fn.win_execute, win, 'bdelete')) + fn.win_execute(win, 'bwipe!') end) it('closed immediately by autocmd #11383', function() @@ -193,7 +193,7 @@ describe('float window', function() end) it('opened with correct position relative to the mouse', function() - meths.nvim_input_mouse('left', 'press', '', 0, 10, 10) + api.nvim_input_mouse('left', 'press', '', 0, 10, 10) local pos = exec_lua([[ local bufnr = vim.api.nvim_create_buf(false, true) @@ -480,67 +480,67 @@ describe('float window', function() it('no crash with bufpos and non-existent window', function() command('new') - local closed_win = meths.nvim_get_current_win().id + local closed_win = api.nvim_get_current_win().id command('close') - local buf = meths.nvim_create_buf(false,false) - meths.nvim_open_win(buf, true, {relative='win', win=closed_win, width=1, height=1, bufpos={0,0}}) + local buf = api.nvim_create_buf(false,false) + api.nvim_open_win(buf, true, {relative='win', win=closed_win, width=1, height=1, bufpos={0,0}}) assert_alive() end) it("no segfault when setting minimal style after clearing local 'fillchars' #19510", function() local float_opts = {relative = 'editor', row = 1, col = 1, width = 1, height = 1} - local float_win = meths.nvim_open_win(0, true, float_opts) - meths.nvim_set_option_value('fillchars', NIL, {win=float_win.id}) + local float_win = api.nvim_open_win(0, true, float_opts) + api.nvim_set_option_value('fillchars', NIL, {win=float_win.id}) float_opts.style = 'minimal' - meths.nvim_win_set_config(float_win, float_opts) + api.nvim_win_set_config(float_win, float_opts) assert_alive() end) it("should re-apply 'style' when present", function() local float_opts = {style = 'minimal', relative = 'editor', row = 1, col = 1, width = 1, height = 1} - local float_win = meths.nvim_open_win(0, true, float_opts) - meths.nvim_set_option_value('number', true, { win = float_win }) + local float_win = api.nvim_open_win(0, true, float_opts) + api.nvim_set_option_value('number', true, { win = float_win }) float_opts.row = 2 - meths.nvim_win_set_config(float_win, float_opts) - eq(false, meths.nvim_get_option_value('number', { win = float_win })) + api.nvim_win_set_config(float_win, float_opts) + eq(false, api.nvim_get_option_value('number', { win = float_win })) end) it("should not re-apply 'style' when missing", function() local float_opts = {style = 'minimal', relative = 'editor', row = 1, col = 1, width = 1, height = 1} - local float_win = meths.nvim_open_win(0, true, float_opts) - meths.nvim_set_option_value('number', true, { win = float_win }) + local float_win = api.nvim_open_win(0, true, float_opts) + api.nvim_set_option_value('number', true, { win = float_win }) float_opts.row = 2 float_opts.style = nil - meths.nvim_win_set_config(float_win, float_opts) - eq(true, meths.nvim_get_option_value('number', { win = float_win })) + api.nvim_win_set_config(float_win, float_opts) + eq(true, api.nvim_get_option_value('number', { win = float_win })) end) it("'scroll' is computed correctly when opening float with splitkeep=screen #20684", function() - meths.nvim_set_option_value('splitkeep', 'screen', {}) + api.nvim_set_option_value('splitkeep', 'screen', {}) local float_opts = {relative = 'editor', row = 1, col = 1, width = 10, height = 10} - local float_win = meths.nvim_open_win(0, true, float_opts) - eq(5, meths.nvim_get_option_value('scroll', {win=float_win.id})) + local float_win = api.nvim_open_win(0, true, float_opts) + eq(5, api.nvim_get_option_value('scroll', {win=float_win.id})) end) it(':unhide works when there are floating windows', function() local float_opts = {relative = 'editor', row = 1, col = 1, width = 5, height = 5} local w0 = curwin() - meths.nvim_open_win(0, false, float_opts) - meths.nvim_open_win(0, false, float_opts) - eq(3, #meths.nvim_list_wins()) + api.nvim_open_win(0, false, float_opts) + api.nvim_open_win(0, false, float_opts) + eq(3, #api.nvim_list_wins()) command('unhide') - eq({ w0 }, meths.nvim_list_wins()) + eq({ w0 }, api.nvim_list_wins()) end) it(':all works when there are floating windows', function() command('args Xa.txt') local float_opts = {relative = 'editor', row = 1, col = 1, width = 5, height = 5} local w0 = curwin() - meths.nvim_open_win(0, false, float_opts) - meths.nvim_open_win(0, false, float_opts) - eq(3, #meths.nvim_list_wins()) + api.nvim_open_win(0, false, float_opts) + api.nvim_open_win(0, false, float_opts) + eq(3, #api.nvim_list_wins()) command('all') - eq({ w0 }, meths.nvim_list_wins()) + eq({ w0 }, api.nvim_list_wins()) end) describe('with only one tabpage,', function() @@ -553,37 +553,37 @@ describe('float window', function() end) describe('closing the last non-floating window gives E444', function() before_each(function() - meths.nvim_open_win(old_buf, true, float_opts) + api.nvim_open_win(old_buf, true, float_opts) end) it('if called from non-floating window', function() - meths.nvim_set_current_win(old_win) + api.nvim_set_current_win(old_win) eq('Vim:E444: Cannot close last window', - pcall_err(meths.nvim_win_close, old_win, false)) + pcall_err(api.nvim_win_close, old_win, false)) end) it('if called from floating window', function() eq('Vim:E444: Cannot close last window', - pcall_err(meths.nvim_win_close, old_win, false)) + pcall_err(api.nvim_win_close, old_win, false)) end) end) describe("deleting the last non-floating window's buffer", function() describe('leaves one window with an empty buffer when there is only one buffer', function() local same_buf_float before_each(function() - same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id + same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id end) after_each(function() eq(old_win, curwin().id) expect('') - eq(1, #meths.nvim_list_wins()) + eq(1, #api.nvim_list_wins()) end) it('if called from non-floating window', function() - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_buf_delete(old_buf, {force = true}) end) it('if called from floating window', function() - meths.nvim_set_current_win(same_buf_float) + api.nvim_set_current_win(same_buf_float) command('autocmd WinLeave * let g:win_leave = nvim_get_current_win()') command('autocmd WinEnter * let g:win_enter = nvim_get_current_win()') - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, eval('g:win_leave')) eq(old_win, eval('g:win_enter')) end) @@ -591,67 +591,67 @@ describe('float window', function() describe('closes other windows with that buffer when there are other buffers', function() local same_buf_float, other_buf, other_buf_float before_each(function() - same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id - other_buf = meths.nvim_create_buf(true, false).id - other_buf_float = meths.nvim_open_win(other_buf, true, float_opts).id + same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id + other_buf = api.nvim_create_buf(true, false).id + other_buf_float = api.nvim_open_win(other_buf, true, float_opts).id insert('bar') - meths.nvim_set_current_win(old_win) + api.nvim_set_current_win(old_win) end) after_each(function() eq(other_buf, curbuf().id) expect('bar') - eq(2, #meths.nvim_list_wins()) + eq(2, #api.nvim_list_wins()) end) it('if called from non-floating window', function() - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_buf_delete(old_buf, {force = true}) eq(old_win, curwin().id) end) it('if called from floating window with the same buffer', function() - meths.nvim_set_current_win(same_buf_float) + api.nvim_set_current_win(same_buf_float) command('autocmd WinLeave * let g:win_leave = nvim_get_current_win()') command('autocmd WinEnter * let g:win_enter = nvim_get_current_win()') - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, eval('g:win_leave')) eq(old_win, eval('g:win_enter')) eq(old_win, curwin().id) end) -- TODO: this case is too hard to deal with pending('if called from floating window with another buffer', function() - meths.nvim_set_current_win(other_buf_float) - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_set_current_win(other_buf_float) + api.nvim_buf_delete(old_buf, {force = true}) end) end) describe('creates an empty buffer when there is only one listed buffer', function() local same_buf_float, unlisted_buf_float before_each(function() - same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id - local unlisted_buf = meths.nvim_create_buf(true, false).id - unlisted_buf_float = meths.nvim_open_win(unlisted_buf, true, float_opts).id + same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id + local unlisted_buf = api.nvim_create_buf(true, false).id + unlisted_buf_float = api.nvim_open_win(unlisted_buf, true, float_opts).id insert('unlisted') command('set nobuflisted') - meths.nvim_set_current_win(old_win) + api.nvim_set_current_win(old_win) end) after_each(function() expect('') - eq(2, #meths.nvim_list_wins()) + eq(2, #api.nvim_list_wins()) end) it('if called from non-floating window', function() - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_buf_delete(old_buf, {force = true}) eq(old_win, curwin().id) end) it('if called from floating window with the same buffer', function() - meths.nvim_set_current_win(same_buf_float) + api.nvim_set_current_win(same_buf_float) command('autocmd WinLeave * let g:win_leave = nvim_get_current_win()') command('autocmd WinEnter * let g:win_enter = nvim_get_current_win()') - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, eval('g:win_leave')) eq(old_win, eval('g:win_enter')) eq(old_win, curwin().id) end) -- TODO: this case is too hard to deal with pending('if called from floating window with an unlisted buffer', function() - meths.nvim_set_current_win(unlisted_buf_float) - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_set_current_win(unlisted_buf_float) + api.nvim_buf_delete(old_buf, {force = true}) end) end) end) @@ -662,20 +662,20 @@ describe('float window', function() command('botright vnew') insert('unlisted') command('set nobuflisted') - meths.nvim_set_current_win(old_win) - same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id + api.nvim_set_current_win(old_win) + same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id end) after_each(function() expect('') - eq(2, #meths.nvim_list_wins()) + eq(2, #api.nvim_list_wins()) end) it('if called from non-floating window with the deleted buffer', function() - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_buf_delete(old_buf, {force = true}) eq(old_win, curwin().id) end) it('if called from floating window with the deleted buffer', function() - meths.nvim_set_current_win(same_buf_float) - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_set_current_win(same_buf_float) + api.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, curwin().id) end) end) @@ -697,28 +697,28 @@ describe('float window', function() describe('without splits, deleting the last listed buffer creates an empty buffer', function() local same_buf_float before_each(function() - meths.nvim_set_current_win(old_win) - same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id + api.nvim_set_current_win(old_win) + same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id end) after_each(function() expect('') - eq(2, #meths.nvim_list_wins()) - eq(2, #meths.nvim_list_tabpages()) + eq(2, #api.nvim_list_wins()) + eq(2, #api.nvim_list_tabpages()) end) it('if called from non-floating window', function() - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_buf_delete(old_buf, {force = true}) eq(old_win, curwin().id) end) it('if called from non-floating window in another tabpage', function() command('tab split') - eq(3, #meths.nvim_list_tabpages()) - meths.nvim_buf_delete(old_buf, {force = true}) + eq(3, #api.nvim_list_tabpages()) + api.nvim_buf_delete(old_buf, {force = true}) end) it('if called from floating window with the same buffer', function() - meths.nvim_set_current_win(same_buf_float) + api.nvim_set_current_win(same_buf_float) command('autocmd WinLeave * let g:win_leave = nvim_get_current_win()') command('autocmd WinEnter * let g:win_enter = nvim_get_current_win()') - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, eval('g:win_leave')) eq(old_win, eval('g:win_enter')) eq(old_win, curwin().id) @@ -728,22 +728,22 @@ describe('float window', function() local same_buf_float before_each(function() command('botright vsplit') - meths.nvim_set_current_buf(unlisted_buf) - meths.nvim_set_current_win(old_win) - same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id + api.nvim_set_current_buf(unlisted_buf) + api.nvim_set_current_win(old_win) + same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id end) after_each(function() expect('') - eq(3, #meths.nvim_list_wins()) - eq(2, #meths.nvim_list_tabpages()) + eq(3, #api.nvim_list_wins()) + eq(2, #api.nvim_list_tabpages()) end) it('if called from non-floating window with the deleted buffer', function() - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_buf_delete(old_buf, {force = true}) eq(old_win, curwin().id) end) it('if called from floating window with the deleted buffer', function() - meths.nvim_set_current_win(same_buf_float) - meths.nvim_buf_delete(old_buf, {force = true}) + api.nvim_set_current_win(same_buf_float) + api.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, curwin().id) end) end) @@ -763,38 +763,38 @@ describe('float window', function() describe('closes the tabpage when all floating windows are closeable', function() local same_buf_float before_each(function() - same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id + same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id end) after_each(function() eq(old_tabpage, curtab().id) expect('oldtab') - eq(1, #meths.nvim_list_tabpages()) + eq(1, #api.nvim_list_tabpages()) end) it('if called from non-floating window', function() - meths.nvim_win_close(old_win, false) + api.nvim_win_close(old_win, false) end) it('if called from floating window', function() - meths.nvim_set_current_win(same_buf_float) - meths.nvim_win_close(old_win, false) + api.nvim_set_current_win(same_buf_float) + api.nvim_win_close(old_win, false) end) end) describe('gives E5601 when there are non-closeable floating windows', function() local other_buf_float before_each(function() command('set nohidden') - local other_buf = meths.nvim_create_buf(true, false).id - other_buf_float = meths.nvim_open_win(other_buf, true, float_opts).id + local other_buf = api.nvim_create_buf(true, false).id + other_buf_float = api.nvim_open_win(other_buf, true, float_opts).id insert('foo') - meths.nvim_set_current_win(old_win) + api.nvim_set_current_win(old_win) end) it('if called from non-floating window', function() eq('Vim:E5601: Cannot close window, only floating window would remain', - pcall_err(meths.nvim_win_close, old_win, false)) + pcall_err(api.nvim_win_close, old_win, false)) end) it('if called from floating window', function() - meths.nvim_set_current_win(other_buf_float) + api.nvim_set_current_win(other_buf_float) eq('Vim:E5601: Cannot close window, only floating window would remain', - pcall_err(meths.nvim_win_close, old_win, false)) + pcall_err(api.nvim_win_close, old_win, false)) end) end) end) @@ -802,27 +802,27 @@ describe('float window', function() describe('closes the tabpage when all floating windows are closeable', function() local same_buf_float, other_buf, other_buf_float before_each(function() - same_buf_float = meths.nvim_open_win(old_buf, false, float_opts).id - other_buf = meths.nvim_create_buf(true, false).id - other_buf_float = meths.nvim_open_win(other_buf, true, float_opts).id - meths.nvim_set_current_win(old_win) + same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id + other_buf = api.nvim_create_buf(true, false).id + other_buf_float = api.nvim_open_win(other_buf, true, float_opts).id + api.nvim_set_current_win(old_win) end) after_each(function() eq(old_tabpage, curtab().id) expect('oldtab') - eq(1, #meths.nvim_list_tabpages()) + eq(1, #api.nvim_list_tabpages()) end) it('if called from non-floating window', function() - meths.nvim_buf_delete(old_buf, {force = false}) + api.nvim_buf_delete(old_buf, {force = false}) end) it('if called from floating window with the same buffer', function() - meths.nvim_set_current_win(same_buf_float) - meths.nvim_buf_delete(old_buf, {force = false}) + api.nvim_set_current_win(same_buf_float) + api.nvim_buf_delete(old_buf, {force = false}) end) -- TODO: this case is too hard to deal with pending('if called from floating window with another buffer', function() - meths.nvim_set_current_win(other_buf_float) - meths.nvim_buf_delete(old_buf, {force = false}) + api.nvim_set_current_win(other_buf_float) + api.nvim_buf_delete(old_buf, {force = false}) end) end) -- TODO: what to do when there are non-closeable floating windows? @@ -869,8 +869,8 @@ describe('float window', function() end) it('can be created and reconfigured', function() - local buf = meths.nvim_create_buf(false,false) - local win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) + local buf = api.nvim_create_buf(false,false) + local win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) local expected_pos = { [4]={{id=1001}, 'NW', 1, 2, 5, true}, } @@ -901,7 +901,7 @@ describe('float window', function() end - meths.nvim_win_set_config(win, {relative='editor', row=0, col=10}) + api.nvim_win_set_config(win, {relative='editor', row=0, col=10}) expected_pos[4][4] = 0 expected_pos[4][5] = 10 if multigrid then @@ -927,7 +927,7 @@ describe('float window', function() ]]) end - meths.nvim_win_close(win, false) + api.nvim_win_close(win, false) if multigrid then screen:expect([[ ## grid 1 @@ -950,8 +950,8 @@ describe('float window', function() it('window position fixed', function() command('rightbelow 20vsplit') - local buf = meths.nvim_create_buf(false,false) - local win = meths.nvim_open_win(buf, false, { + local buf = api.nvim_create_buf(false,false) + local win = api.nvim_open_win(buf, false, { relative='win', width=15, height=2, row=2, col=10, anchor='NW', fixed=true}) if multigrid then @@ -986,7 +986,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {fixed=false}) + api.nvim_win_set_config(win, {fixed=false}) if multigrid then screen:expect_unchanged() @@ -1010,8 +1010,8 @@ describe('float window', function() -- or something. command("set redrawdebug=compositor") command("set wd=1") - local buf = meths.nvim_create_buf(false,false) - local win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) + local buf = api.nvim_create_buf(false,false) + local win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) local expected_pos = { [4]={{id=1001}, 'NW', 1, 2, 5, true}, } @@ -1042,7 +1042,7 @@ describe('float window', function() end - meths.nvim_win_set_config(win, {relative='editor', row=0, col=10}) + api.nvim_win_set_config(win, {relative='editor', row=0, col=10}) expected_pos[4][4] = 0 expected_pos[4][5] = 10 if multigrid then @@ -1068,7 +1068,7 @@ describe('float window', function() ]]) end - meths.nvim_win_close(win, false) + api.nvim_win_close(win, false) if multigrid then screen:expect([[ ## grid 1 @@ -1090,16 +1090,16 @@ describe('float window', function() end) it('return their configuration', function() - local buf = meths.nvim_create_buf(false, false) - local win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=3, col=5, zindex=60}) + local buf = api.nvim_create_buf(false, false) + local win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=3, col=5, zindex=60}) local expected = {anchor='NW', col=5, external=false, focusable=true, height=2, relative='editor', row=3, width=20, zindex=60, hide=false} - eq(expected, meths.nvim_win_get_config(win)) + eq(expected, api.nvim_win_get_config(win)) - eq({relative='', external=false, focusable=true, hide=false}, meths.nvim_win_get_config(0)) + eq({relative='', external=false, focusable=true, hide=false}, api.nvim_win_get_config(0)) if multigrid then - meths.nvim_win_set_config(win, {external=true, width=10, height=1}) - eq({external=true,focusable=true,width=10,height=1,relative='',hide=false}, meths.nvim_win_get_config(win)) + api.nvim_win_set_config(win, {external=true, width=10, height=1}) + eq({external=true,focusable=true,width=10,height=1,relative='',hide=false}, api.nvim_win_get_config(win)) end end) @@ -1107,7 +1107,7 @@ describe('float window', function() command('set number') command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ixygg') - local win = meths.nvim_open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10}) + local win = api.nvim_open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1138,8 +1138,8 @@ describe('float window', function() ]]) end - local buf = meths.nvim_create_buf(false, true) - meths.nvim_win_set_buf(win, buf) + local buf = api.nvim_create_buf(false, true) + api.nvim_win_set_buf(win, buf) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1175,7 +1175,7 @@ describe('float window', function() command('set foldcolumn=1') command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ixygg') - local win = meths.nvim_open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) + local win = api.nvim_open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1239,8 +1239,8 @@ describe('float window', function() end command('sign unplace 1 buffer=1') - local buf = meths.nvim_create_buf(false, true) - meths.nvim_win_set_buf(win, buf) + local buf = api.nvim_create_buf(false, true) + api.nvim_win_set_buf(win, buf) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1275,7 +1275,7 @@ describe('float window', function() command('set foldcolumn=1') command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ixygg') - local win = meths.nvim_open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) + local win = api.nvim_open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1339,8 +1339,8 @@ describe('float window', function() end command('sign unplace 1 buffer=1') - local buf = meths.nvim_create_buf(false, true) - meths.nvim_win_set_buf(win, buf) + local buf = api.nvim_create_buf(false, true) + api.nvim_win_set_buf(win, buf) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1376,7 +1376,7 @@ describe('float window', function() command('set statuscolumn=%l%s%C') command('hi NormalFloat guibg=#333333 guifg=NONE') feed('ixygg') - meths.nvim_open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) + api.nvim_open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1407,10 +1407,10 @@ describe('float window', function() end) it('can have border', function() - local buf = meths.nvim_create_buf(false, false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', + local buf = api.nvim_create_buf(false, false) + api.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', ' BORDAA '}) - local win = meths.nvim_open_win(buf, false, {relative='editor', width=9, height=2, row=2, col=5, border="double"}) + local win = api.nvim_open_win(buf, false, {relative='editor', width=9, height=2, row=2, col=5, border="double"}) if multigrid then screen:expect{grid=[[ @@ -1445,7 +1445,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {border="single"}) + api.nvim_win_set_config(win, {border="single"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1479,7 +1479,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {border="rounded"}) + api.nvim_win_set_config(win, {border="rounded"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1513,7 +1513,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {border="solid"}) + api.nvim_win_set_config(win, {border="solid"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1548,7 +1548,7 @@ describe('float window', function() end -- support: ascii char, UTF-8 char, composed char, highlight per char - meths.nvim_win_set_config(win, {border={"x", {"å", "ErrorMsg"}, {"\\"}, {"n̈̊", "Search"}}}) + api.nvim_win_set_config(win, {border={"x", {"å", "ErrorMsg"}, {"\\"}, {"n̈̊", "Search"}}}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1582,7 +1582,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {border="none"}) + api.nvim_win_set_config(win, {border="none"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1613,7 +1613,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {border={"", "", "", ">", "", "", "", "<"}}) + api.nvim_win_set_config(win, {border={"", "", "", ">", "", "", "", "<"}}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1644,7 +1644,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {border={"", "_", "", "", "", "-", "", ""}}) + api.nvim_win_set_config(win, {border={"", "_", "", "", "", "-", "", ""}}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1686,7 +1686,7 @@ describe('float window', function() of border shadow ]] - meths.nvim_win_set_config(win, {border="shadow"}) + api.nvim_win_set_config(win, {border="shadow"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1725,13 +1725,13 @@ describe('float window', function() end) it('validates title title_pos', function() - local buf = meths.nvim_create_buf(false,false) + local buf = api.nvim_create_buf(false,false) eq("title requires border to be set", - pcall_err(meths.nvim_open_win,buf, false, { + pcall_err(api.nvim_open_win,buf, false, { relative='editor', width=9, height=2, row=2, col=5, title='Title', })) eq("title_pos requires title to be set", - pcall_err(meths.nvim_open_win,buf, false, { + pcall_err(api.nvim_open_win,buf, false, { relative='editor', width=9, height=2, row=2, col=5, border='single', title_pos='left', })) @@ -1759,13 +1759,13 @@ describe('float window', function() end) it('validates footer footer_pos', function() - local buf = meths.nvim_create_buf(false,false) + local buf = api.nvim_create_buf(false,false) eq("footer requires border to be set", - pcall_err(meths.nvim_open_win,buf, false, { + pcall_err(api.nvim_open_win,buf, false, { relative='editor', width=9, height=2, row=2, col=5, footer='Footer', })) eq("footer_pos requires footer to be set", - pcall_err(meths.nvim_open_win,buf, false, { + pcall_err(api.nvim_open_win,buf, false, { relative='editor', width=9, height=2, row=2, col=5, border='single', footer_pos='left', })) @@ -1793,10 +1793,10 @@ describe('float window', function() end) it('center aligned title longer than window width #25746', function() - local buf = meths.nvim_create_buf(false, false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', + local buf = api.nvim_create_buf(false, false) + api.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', ' BORDAA '}) - local win = meths.nvim_open_win(buf, false, { + local win = api.nvim_open_win(buf, false, { relative='editor', width=9, height=2, row=2, col=5, border="double", title = "abcdefghijklmnopqrstuvwxyz",title_pos = "center", }) @@ -1834,15 +1834,15 @@ describe('float window', function() ]]} end - meths.nvim_win_close(win, false) + api.nvim_win_close(win, false) assert_alive() end) it('border with title', function() - local buf = meths.nvim_create_buf(false, false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', + local buf = api.nvim_create_buf(false, false) + api.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', ' BORDAA '}) - local win = meths.nvim_open_win(buf, false, { + local win = api.nvim_open_win(buf, false, { relative='editor', width=9, height=2, row=2, col=5, border="double", title = "Left",title_pos = "left", }) @@ -1880,7 +1880,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {title= "Center",title_pos="center"}) + api.nvim_win_set_config(win, {title= "Center",title_pos="center"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1914,7 +1914,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {title= "Right",title_pos="right"}) + api.nvim_win_set_config(win, {title= "Right",title_pos="right"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1948,7 +1948,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {title= { {"🦄"},{"BB"}},title_pos="right"}) + api.nvim_win_set_config(win, {title= { {"🦄"},{"BB"}},title_pos="right"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -1984,10 +1984,10 @@ describe('float window', function() end) it('border with footer', function() - local buf = meths.nvim_create_buf(false, false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', + local buf = api.nvim_create_buf(false, false) + api.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', ' BORDAA '}) - local win = meths.nvim_open_win(buf, false, { + local win = api.nvim_open_win(buf, false, { relative='editor', width=9, height=2, row=2, col=5, border="double", footer = "Left",footer_pos = "left", }) @@ -2025,7 +2025,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {footer= "Center",footer_pos="center"}) + api.nvim_win_set_config(win, {footer= "Center",footer_pos="center"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2059,7 +2059,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {footer= "Right",footer_pos="right"}) + api.nvim_win_set_config(win, {footer= "Right",footer_pos="right"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2093,7 +2093,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {footer= { {"🦄"},{"BB"}},footer_pos="right"}) + api.nvim_win_set_config(win, {footer= { {"🦄"},{"BB"}},footer_pos="right"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2129,10 +2129,10 @@ describe('float window', function() end) it('border with title and footer', function() - local buf = meths.nvim_create_buf(false, false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', + local buf = api.nvim_create_buf(false, false) + api.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', ' BORDAA '}) - local win = meths.nvim_open_win(buf, false, { + local win = api.nvim_open_win(buf, false, { relative='editor', width=9, height=2, row=2, col=5, border="double", title = "Left", title_pos = "left", footer = "Right", footer_pos = "right", }) @@ -2170,7 +2170,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {title= "Center",title_pos="center",footer= "Center",footer_pos="center"}) + api.nvim_win_set_config(win, {title= "Center",title_pos="center",footer= "Center",footer_pos="center"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2204,7 +2204,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {title= "Right",title_pos="right",footer= "Left",footer_pos="left"}) + api.nvim_win_set_config(win, {title= "Right",title_pos="right",footer= "Left",footer_pos="left"}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2240,7 +2240,7 @@ describe('float window', function() command('hi B0 guibg=Red guifg=Black') command('hi B1 guifg=White') - meths.nvim_win_set_config(win, { + api.nvim_win_set_config(win, { title = {{"🦄"}, {"BB", {"B0", "B1"}}}, title_pos = "right", footer= {{"🦄"}, {"BB", {"B0", "B1"}}}, footer_pos = "right", }) @@ -2279,8 +2279,8 @@ describe('float window', function() end) it('terminates border on edge of viewport when window extends past viewport', function() - local buf = meths.nvim_create_buf(false, false) - meths.nvim_open_win(buf, false, {relative='editor', width=40, height=7, row=0, col=0, border="single", zindex=201}) + local buf = api.nvim_create_buf(false, false) + api.nvim_open_win(buf, false, {relative='editor', width=40, height=7, row=0, col=0, border="single", zindex=201}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2314,10 +2314,10 @@ describe('float window', function() it('with border show popupmenu', function() screen:try_resize(40,10) - local buf = meths.nvim_create_buf(false, false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'aaa aab ', + local buf = api.nvim_create_buf(false, false) + api.nvim_buf_set_lines(buf, 0, -1, true, {'aaa aab ', 'abb acc ', ''}) - meths.nvim_open_win(buf, true, {relative='editor', width=9, height=3, row=0, col=5, border="double"}) + api.nvim_open_win(buf, true, {relative='editor', width=9, height=3, row=0, col=5, border="double"}) feed 'G' if multigrid then @@ -2483,10 +2483,10 @@ describe('float window', function() it('show ruler of current floating window', function() command 'set ruler' - local buf = meths.nvim_create_buf(false, false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'aaa aab ', + local buf = api.nvim_create_buf(false, false) + api.nvim_buf_set_lines(buf, 0, -1, true, {'aaa aab ', 'abb acc '}) - meths.nvim_open_win(buf, true, {relative='editor', width=9, height=3, row=0, col=5}) + api.nvim_open_win(buf, true, {relative='editor', width=9, height=3, row=0, col=5}) feed 'gg' if multigrid then @@ -2553,7 +2553,7 @@ describe('float window', function() it("correct ruler position in current float with 'rulerformat' set", function() command 'set ruler rulerformat=fish:<><' - meths.nvim_open_win(0, true, {relative='editor', width=9, height=3, row=0, col=5}) + api.nvim_open_win(0, true, {relative='editor', width=9, height=3, row=0, col=5}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2586,11 +2586,11 @@ describe('float window', function() it('does not show ruler of not-last current float during ins-completion', function() screen:try_resize(50,9) command 'set ruler showmode' - meths.nvim_open_win(0, false, {relative='editor', width=3, height=3, row=0, col=0}) - meths.nvim_open_win(0, false, {relative='editor', width=3, height=3, row=0, col=5}) + api.nvim_open_win(0, false, {relative='editor', width=3, height=3, row=0, col=0}) + api.nvim_open_win(0, false, {relative='editor', width=3, height=3, row=0, col=5}) feed 'w' - neq('', meths.nvim_win_get_config(0).relative) - neq(funcs.winnr '$', funcs.winnr()) + neq('', api.nvim_win_get_config(0).relative) + neq(fn.winnr '$', fn.winnr()) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2660,9 +2660,9 @@ describe('float window', function() it('can have minimum size', function() insert("the background text") - local buf = meths.nvim_create_buf(false, true) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'x'}) - local win = meths.nvim_open_win(buf, false, {relative='win', width=1, height=1, row=0, col=4, focusable=false}) + local buf = api.nvim_create_buf(false, true) + api.nvim_buf_set_lines(buf, 0, -1, true, {'x'}) + local win = api.nvim_open_win(buf, false, {relative='win', width=1, height=1, row=0, col=4, focusable=false}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2686,7 +2686,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {relative='win', row=0, col=15}) + api.nvim_win_set_config(win, {relative='win', row=0, col=15}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2710,7 +2710,7 @@ describe('float window', function() ]]) end - meths.nvim_win_close(win,false) + api.nvim_win_close(win,false) if multigrid then screen:expect([[ ## grid 1 @@ -2746,8 +2746,8 @@ describe('float window', function() command('sargument 6') local float_opts = { relative = 'editor', row = 6, col = 0, width = 40, height = 1 } - meths.nvim_win_set_config(w3, float_opts) - meths.nvim_win_set_config(w4, float_opts) + api.nvim_win_set_config(w3, float_opts) + api.nvim_win_set_config(w4, float_opts) command('wincmd =') if multigrid then screen:expect{grid=[[ @@ -2876,36 +2876,36 @@ describe('float window', function() end) it('API has proper error messages', function() - local buf = meths.nvim_create_buf(false,false) + local buf = api.nvim_create_buf(false,false) eq("Invalid key: 'bork'", - pcall_err(meths.nvim_open_win,buf, false, {width=20,height=2,bork=true})) + pcall_err(api.nvim_open_win,buf, false, {width=20,height=2,bork=true})) eq("'win' key is only valid with relative='win'", - pcall_err(meths.nvim_open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,win=0})) + pcall_err(api.nvim_open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,win=0})) eq("Only one of 'relative' and 'external' must be used", - pcall_err(meths.nvim_open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,external=true})) + pcall_err(api.nvim_open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,external=true})) eq("Invalid value of 'relative' key", - pcall_err(meths.nvim_open_win,buf, false, {width=20,height=2,relative='shell',row=0,col=0})) + pcall_err(api.nvim_open_win,buf, false, {width=20,height=2,relative='shell',row=0,col=0})) eq("Invalid value of 'anchor' key", - pcall_err(meths.nvim_open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,anchor='bottom'})) + pcall_err(api.nvim_open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,anchor='bottom'})) eq("'relative' requires 'row'/'col' or 'bufpos'", - pcall_err(meths.nvim_open_win,buf, false, {width=20,height=2,relative='editor'})) + pcall_err(api.nvim_open_win,buf, false, {width=20,height=2,relative='editor'})) eq("'width' key must be a positive Integer", - pcall_err(meths.nvim_open_win,buf, false, {width=-1,height=2,relative='editor', row=0, col=0})) + pcall_err(api.nvim_open_win,buf, false, {width=-1,height=2,relative='editor', row=0, col=0})) eq("'height' key must be a positive Integer", - pcall_err(meths.nvim_open_win,buf, false, {width=20,height=-1,relative='editor', row=0, col=0})) + pcall_err(api.nvim_open_win,buf, false, {width=20,height=-1,relative='editor', row=0, col=0})) eq("'height' key must be a positive Integer", - pcall_err(meths.nvim_open_win,buf, false, {width=20,height=0,relative='editor', row=0, col=0})) + pcall_err(api.nvim_open_win,buf, false, {width=20,height=0,relative='editor', row=0, col=0})) eq("Must specify 'width'", - pcall_err(meths.nvim_open_win,buf, false, {relative='editor', row=0, col=0})) + pcall_err(api.nvim_open_win,buf, false, {relative='editor', row=0, col=0})) eq("Must specify 'height'", - pcall_err(meths.nvim_open_win,buf, false, {relative='editor', row=0, col=0, width=2})) + pcall_err(api.nvim_open_win,buf, false, {relative='editor', row=0, col=0, width=2})) end) it('can be placed relative window or cursor', function() screen:try_resize(40,9) - meths.nvim_buf_set_lines(0, 0, -1, true, {'just some', 'example text'}) + api.nvim_buf_set_lines(0, 0, -1, true, {'just some', 'example text'}) feed('gge') - local oldwin = meths.nvim_get_current_win() + local oldwin = api.nvim_get_current_win() command('below split') if multigrid then screen:expect([[ @@ -2940,9 +2940,9 @@ describe('float window', function() ]]) end - local buf = meths.nvim_create_buf(false,false) + local buf = api.nvim_create_buf(false,false) -- no 'win' arg, relative default window - local win = meths.nvim_open_win(buf, false, {relative='win', width=20, height=2, row=0, col=10}) + local win = api.nvim_open_win(buf, false, {relative='win', width=20, height=2, row=0, col=10}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -2981,7 +2981,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {relative='cursor', row=1, col=-2}) + api.nvim_win_set_config(win, {relative='cursor', row=1, col=-2}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3020,7 +3020,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {relative='cursor', row=0, col=0, anchor='SW'}) + api.nvim_win_set_config(win, {relative='cursor', row=0, col=0, anchor='SW'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3059,7 +3059,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {relative='win', win=oldwin, row=1, col=10, anchor='NW'}) + api.nvim_win_set_config(win, {relative='win', win=oldwin, row=1, col=10, anchor='NW'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3098,7 +3098,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {relative='win', win=oldwin, row=3, col=39, anchor='SE'}) + api.nvim_win_set_config(win, {relative='win', win=oldwin, row=3, col=39, anchor='SE'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3137,7 +3137,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {relative='win', win=0, row=0, col=50, anchor='NE'}) + api.nvim_win_set_config(win, {relative='win', win=0, row=0, col=50, anchor='NE'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3207,7 +3207,7 @@ describe('float window', function() it('always anchor to corner including border', function() screen:try_resize(40,13) - meths.nvim_buf_set_lines(0, 0, -1, true, {'just some example text', 'some more example text'}) + api.nvim_buf_set_lines(0, 0, -1, true, {'just some example text', 'some more example text'}) feed('ggeee') command('below split') if multigrid then @@ -3243,10 +3243,10 @@ describe('float window', function() ]]) end - local buf = meths.nvim_create_buf(false, false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', + local buf = api.nvim_create_buf(false, false) + api.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ', ' BORDAA '}) - local win = meths.nvim_open_win(buf, false, {relative='cursor', width=9, height=2, row=1, col=-2, border="double"}) + local win = api.nvim_open_win(buf, false, {relative='cursor', width=9, height=2, row=1, col=-2, border="double"}) if multigrid then screen:expect{grid=[[ @@ -3290,7 +3290,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {relative='cursor', row=0, col=-2, anchor='NE'}) + api.nvim_win_set_config(win, {relative='cursor', row=0, col=-2, anchor='NE'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3333,7 +3333,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {relative='cursor', row=1, col=-2, anchor='SE'}) + api.nvim_win_set_config(win, {relative='cursor', row=1, col=-2, anchor='SE'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3376,7 +3376,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {relative='cursor', row=0, col=-2, anchor='SW'}) + api.nvim_win_set_config(win, {relative='cursor', row=0, col=-2, anchor='SW'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3596,8 +3596,8 @@ describe('float window', function() it('can be placed relative text in a window', function() screen:try_resize(30,5) - local firstwin = meths.nvim_get_current_win().id - meths.nvim_buf_set_lines(0, 0, -1, true, {'just some', 'example text that is wider than the window', '', '', 'more text'}) + local firstwin = api.nvim_get_current_win().id + api.nvim_buf_set_lines(0, 0, -1, true, {'just some', 'example text that is wider than the window', '', '', 'more text'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3620,10 +3620,10 @@ describe('float window', function() ]]} end - local buf = meths.nvim_create_buf(false,false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'some info!'}) + local buf = api.nvim_create_buf(false,false) + api.nvim_buf_set_lines(buf, 0, -1, true, {'some info!'}) - local win = meths.nvim_open_win(buf, false, {relative='win', width=12, height=1, bufpos={1,32}}) + local win = api.nvim_open_win(buf, false, {relative='win', width=12, height=1, bufpos={1,32}}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3651,7 +3651,7 @@ describe('float window', function() ]]} end eq({relative='win', width=12, height=1, bufpos={1,32}, anchor='NW', hide=false, - external=false, col=0, row=1, win=firstwin, focusable=true, zindex=50}, meths.nvim_win_get_config(win)) + external=false, col=0, row=1, win=firstwin, focusable=true, zindex=50}, api.nvim_win_get_config(win)) feed('') if multigrid then @@ -3739,7 +3739,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {relative='win', bufpos={1,32}, anchor='SW'}) + api.nvim_win_set_config(win, {relative='win', bufpos={1,32}, anchor='SW'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3812,7 +3812,7 @@ describe('float window', function() end command('close') - meths.nvim_win_set_config(win, {relative='win', bufpos={1,32}, anchor='NW', col=-2}) + api.nvim_win_set_config(win, {relative='win', bufpos={1,32}, anchor='NW', col=-2}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3843,7 +3843,7 @@ describe('float window', function() ]]} end - meths.nvim_win_set_config(win, {relative='win', bufpos={1,32}, row=2}) + api.nvim_win_set_config(win, {relative='win', bufpos={1,32}, row=2}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3924,9 +3924,9 @@ describe('float window', function() ]]) end - local buf = meths.nvim_create_buf(false,true) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'some floaty text'}) - meths.nvim_open_win(buf, false, {relative='editor', width=20, height=1, row=3, col=1}) + local buf = api.nvim_create_buf(false,true) + api.nvim_buf_set_lines(buf, 0, -1, true, {'some floaty text'}) + api.nvim_open_win(buf, false, {relative='editor', width=20, height=1, row=3, col=1}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -3959,8 +3959,8 @@ describe('float window', function() local screen2 = Screen.new(40,7) screen2:attach(nil, session2) screen2:set_default_attr_ids(attrs) - local buf = meths.nvim_create_buf(false,false) - meths.nvim_open_win(buf, true, {relative='editor', width=20, height=2, row=2, col=5}) + local buf = api.nvim_create_buf(false,false) + api.nvim_open_win(buf, true, {relative='editor', width=20, height=2, row=2, col=5}) local expected_pos = { [2]={{id=1001}, 'NW', 1, 2, 5} } @@ -3986,9 +3986,9 @@ describe('float window', function() it('handles resized screen', function() - local buf = meths.nvim_create_buf(false,false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'such', 'very', 'float'}) - local win = meths.nvim_open_win(buf, false, {relative='editor', width=15, height=4, row=2, col=10}) + local buf = api.nvim_create_buf(false,false) + api.nvim_buf_set_lines(buf, 0, -1, true, {'such', 'very', 'float'}) + local win = api.nvim_open_win(buf, false, {relative='editor', width=15, height=4, row=2, col=10}) local expected_pos = { [4]={{id=1001}, 'NW', 1, 2, 10, true}, } @@ -4151,7 +4151,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {height=3}) + api.nvim_win_set_config(win, {height=3}) feed('gg') if multigrid then screen:expect{grid=[[ @@ -4436,8 +4436,8 @@ describe('float window', function() command("set inccommand=split") command("set laststatus=2") - local buf = meths.nvim_create_buf(false,false) - meths.nvim_open_win(buf, true, {relative='editor', width=30, height=3, row=2, col=0}) + local buf = api.nvim_create_buf(false,false) + api.nvim_open_win(buf, true, {relative='editor', width=30, height=3, row=2, col=0}) insert([[ foo @@ -4533,17 +4533,17 @@ describe('float window', function() end) it('does not crash when set cmdheight #9680', function() - local buf = meths.nvim_create_buf(false,false) - meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) + local buf = api.nvim_create_buf(false,false) + api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) command("set cmdheight=2") - eq(1, meths.nvim_eval('1')) + eq(1, api.nvim_eval('1')) end) describe('and completion', function() before_each(function() - local buf = meths.nvim_create_buf(false,false) - local win = meths.nvim_open_win(buf, true, {relative='editor', width=12, height=4, row=2, col=5}).id - meths.nvim_set_option_value('winhl', 'Normal:ErrorMsg', {win=win}) + local buf = api.nvim_create_buf(false,false) + local win = api.nvim_open_win(buf, true, {relative='editor', width=12, height=4, row=2, col=5}).id + api.nvim_set_option_value('winhl', 'Normal:ErrorMsg', {win=win}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -4573,7 +4573,7 @@ describe('float window', function() it('with builtin popupmenu', function() feed('ix ') - funcs.complete(3, {'aa', 'word', 'longtext'}) + fn.complete(3, {'aa', 'word', 'longtext'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -4636,7 +4636,7 @@ describe('float window', function() end feed('wi') - funcs.complete(1, {'xx', 'yy', 'zz'}) + fn.complete(1, {'xx', 'yy', 'zz'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -4736,7 +4736,7 @@ describe('float window', function() it('with ext_popupmenu', function() screen:set_option('ext_popupmenu', true) feed('ix ') - funcs.complete(3, {'aa', 'word', 'longtext'}) + fn.complete(3, {'aa', 'word', 'longtext'}) local items = {{"aa", "", "", ""}, {"word", "", "", ""}, {"longtext", "", "", ""}} if multigrid then screen:expect{grid=[[ @@ -4796,7 +4796,7 @@ describe('float window', function() end feed('wi') - funcs.complete(1, {'xx', 'yy', 'zz'}) + fn.complete(1, {'xx', 'yy', 'zz'}) items = {{"xx", "", "", ""}, {"yy", "", "", ""}, {"zz", "", "", ""}} if multigrid then screen:expect{grid=[[ @@ -4862,7 +4862,7 @@ describe('float window', function() before_each(function() command('hi NormalFloat guibg=#333333 guifg=NONE') feed('i') - funcs.complete(1, {'aa', 'word', 'longtext'}) + fn.complete(1, {'aa', 'word', 'longtext'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -4891,9 +4891,9 @@ describe('float window', function() ]]) end - local buf = meths.nvim_create_buf(false,true) - meths.nvim_buf_set_lines(buf,0,-1,true,{"some info", "about item"}) - win = meths.nvim_open_win(buf, false, {relative='cursor', width=12, height=2, row=1, col=10}) + local buf = api.nvim_create_buf(false,true) + api.nvim_buf_set_lines(buf,0,-1,true,{"some info", "about item"}) + win = api.nvim_open_win(buf, false, {relative='cursor', width=12, height=2, row=1, col=10}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -4955,7 +4955,7 @@ describe('float window', function() ]]) end - meths.nvim_win_close(win, false) + api.nvim_win_close(win, false) if multigrid then screen:expect([[ ## grid 1 @@ -4977,7 +4977,7 @@ describe('float window', function() end) it('and close float first', function() - meths.nvim_win_close(win, false) + api.nvim_win_close(win, false) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -5029,10 +5029,10 @@ describe('float window', function() end) it("can use Normal as background", function() - local buf = meths.nvim_create_buf(false,false) - meths.nvim_buf_set_lines(buf,0,-1,true,{"here", "float"}) - local win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) - meths.nvim_set_option_value('winhl', 'Normal:Normal', {win=win}) + local buf = api.nvim_create_buf(false,false) + api.nvim_buf_set_lines(buf,0,-1,true,{"here", "float"}) + local win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) + api.nvim_set_option_value('winhl', 'Normal:Normal', {win=win}) if multigrid then screen:expect{grid=[[ @@ -5072,10 +5072,10 @@ describe('float window', function() -- the default, but be explicit: command("set laststatus=1") command("set hidden") - meths.nvim_buf_set_lines(0,0,-1,true,{"x"}) - local buf = meths.nvim_create_buf(false,false) - win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) - meths.nvim_buf_set_lines(buf,0,-1,true,{"y"}) + api.nvim_buf_set_lines(0,0,-1,true,{"x"}) + local buf = api.nvim_create_buf(false,false) + win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) + api.nvim_buf_set_lines(buf,0,-1,true,{"y"}) expected_pos = { [4]={{id=1001}, 'NW', 1, 2, 5, true} } @@ -5160,7 +5160,7 @@ describe('float window', function() end) it("w with focusable=false", function() - meths.nvim_win_set_config(win, {focusable=false}) + api.nvim_win_set_config(win, {focusable=false}) expected_pos[4][6] = false feed("wi") -- i to provoke redraw if multigrid then @@ -5271,7 +5271,7 @@ describe('float window', function() it("focus by mouse", function() if multigrid then - meths.nvim_input_mouse('left', 'press', '', 4, 0, 0) + api.nvim_input_mouse('left', 'press', '', 4, 0, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -5286,7 +5286,7 @@ describe('float window', function() {2:~ }| ]], float_pos=expected_pos} else - meths.nvim_input_mouse('left', 'press', '', 0, 2, 5) + api.nvim_input_mouse('left', 'press', '', 0, 2, 5) screen:expect([[ x | {0:~ }| @@ -5298,7 +5298,7 @@ describe('float window', function() end if multigrid then - meths.nvim_input_mouse('left', 'press', '', 2, 0, 0) + api.nvim_input_mouse('left', 'press', '', 2, 0, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -5313,7 +5313,7 @@ describe('float window', function() {2:~ }| ]], float_pos=expected_pos} else - meths.nvim_input_mouse('left', 'press', '', 0, 0, 0) + api.nvim_input_mouse('left', 'press', '', 0, 0, 0) screen:expect([[ ^x | {0:~ }| @@ -5326,11 +5326,11 @@ describe('float window', function() end) it("focus by mouse (focusable=false)", function() - meths.nvim_win_set_config(win, {focusable=false}) - meths.nvim_buf_set_lines(0, -1, -1, true, {"a"}) + api.nvim_win_set_config(win, {focusable=false}) + api.nvim_buf_set_lines(0, -1, -1, true, {"a"}) expected_pos[4][6] = false if multigrid then - meths.nvim_input_mouse('left', 'press', '', 4, 0, 0) + api.nvim_input_mouse('left', 'press', '', 4, 0, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -5346,7 +5346,7 @@ describe('float window', function() {2:~ }| ]], float_pos=expected_pos} else - meths.nvim_input_mouse('left', 'press', '', 0, 2, 5) + api.nvim_input_mouse('left', 'press', '', 0, 2, 5) screen:expect([[ x | ^a | @@ -5358,7 +5358,7 @@ describe('float window', function() end if multigrid then - meths.nvim_input_mouse('left', 'press', '', 2, 0, 0) + api.nvim_input_mouse('left', 'press', '', 2, 0, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -5374,7 +5374,7 @@ describe('float window', function() {2:~ }| ]], float_pos=expected_pos, unchanged=true} else - meths.nvim_input_mouse('left', 'press', '', 0, 0, 0) + api.nvim_input_mouse('left', 'press', '', 0, 0, 0) screen:expect([[ ^x | a | @@ -6156,7 +6156,7 @@ describe('float window', function() -- enter first float feed('') -- enter second float - meths.nvim_open_win(0, true, {relative='editor', width=20, height=2, row=4, col=8}) + api.nvim_open_win(0, true, {relative='editor', width=20, height=2, row=4, col=8}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -6476,7 +6476,7 @@ describe('float window', function() end if multigrid then - meths.nvim_win_set_config(0, {external=true, width=30, height=2}) + api.nvim_win_set_config(0, {external=true, width=30, height=2}) expected_pos = {[4]={external=true}} screen:expect{grid=[[ ## grid 1 @@ -6494,7 +6494,7 @@ describe('float window', function() ]], float_pos=expected_pos} else eq("UI doesn't support external windows", - pcall_err(meths.nvim_win_set_config, 0, {external=true, width=30, height=2})) + pcall_err(api.nvim_win_set_config, 0, {external=true, width=30, height=2})) return end @@ -6520,7 +6520,7 @@ describe('float window', function() end) it('J (float with border)', function() - meths.nvim_win_set_config(win, {relative='editor', width=20, height=2, row=2, col=5, border='single'}) + api.nvim_win_set_config(win, {relative='editor', width=20, height=2, row=2, col=5, border='single'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -6625,7 +6625,7 @@ describe('float window', function() for i = 1,5 do feed(i.."w") feed_command("enew") - meths.nvim_buf_set_lines(0, 0,-1,true,{tostring(i)}) + api.nvim_buf_set_lines(0, 0,-1,true,{tostring(i)}) end if multigrid then @@ -6681,7 +6681,7 @@ describe('float window', function() for i = 1,5 do feed(i.."w") feed(''..k) - local nr = funcs.winnr() + local nr = fn.winnr() eq(v[i],nr, "when using "..k.." from window "..i) end end @@ -6692,7 +6692,7 @@ describe('float window', function() if j ~= i then feed(j.."w") feed('p') - local nr = funcs.winnr() + local nr = fn.winnr() eq(i,nr, "when using p to window "..i.." from window "..j) end end @@ -6792,7 +6792,7 @@ describe('float window', function() it(":tabnew and :tabnext (external)", function() if multigrid then -- also test external window wider than main screen - meths.nvim_win_set_config(win, {external=true, width=65, height=4}) + api.nvim_win_set_config(win, {external=true, width=65, height=4}) expected_pos = {[4]={external=true}} feed(":tabnew") screen:expect{grid=[[ @@ -6814,7 +6814,7 @@ describe('float window', function() ]], float_pos=expected_pos} else eq("UI doesn't support external windows", - pcall_err(meths.nvim_win_set_config, 0, {external=true, width=65, height=4})) + pcall_err(api.nvim_win_set_config, 0, {external=true, width=65, height=4})) end feed(":tabnext") @@ -6862,9 +6862,9 @@ describe('float window', function() end) it("left drag changes visual selection in float window", function() - local buf = meths.nvim_create_buf(false,false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) - meths.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=2, col=5}) + local buf = api.nvim_create_buf(false,false) + api.nvim_buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) + api.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=2, col=5}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -6886,7 +6886,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} - meths.nvim_input_mouse('left', 'press', '', 4, 0, 0) + api.nvim_input_mouse('left', 'press', '', 4, 0, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -6907,7 +6907,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} - meths.nvim_input_mouse('left', 'drag', '', 4, 1, 2) + api.nvim_input_mouse('left', 'drag', '', 4, 1, 2) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -6938,7 +6938,7 @@ describe('float window', function() | ]]} - meths.nvim_input_mouse('left', 'press', '', 0, 2, 5) + api.nvim_input_mouse('left', 'press', '', 0, 2, 5) screen:expect{grid=[[ | {0:~ }| @@ -6949,7 +6949,7 @@ describe('float window', function() | ]]} - meths.nvim_input_mouse('left', 'drag', '', 0, 3, 7) + api.nvim_input_mouse('left', 'drag', '', 0, 3, 7) screen:expect{grid=[[ | {0:~ }| @@ -6963,9 +6963,9 @@ describe('float window', function() end) it("left drag changes visual selection in float window with border", function() - local buf = meths.nvim_create_buf(false,false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) - meths.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=0, col=5, border='single'}) + local buf = api.nvim_create_buf(false,false) + api.nvim_buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) + api.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=0, col=5, border='single'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -6989,7 +6989,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} - meths.nvim_input_mouse('left', 'press', '', 4, 1, 1) + api.nvim_input_mouse('left', 'press', '', 4, 1, 1) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -7012,7 +7012,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} - meths.nvim_input_mouse('left', 'drag', '', 4, 2, 3) + api.nvim_input_mouse('left', 'drag', '', 4, 2, 3) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -7045,7 +7045,7 @@ describe('float window', function() | ]]} - meths.nvim_input_mouse('left', 'press', '', 0, 1, 6) + api.nvim_input_mouse('left', 'press', '', 0, 1, 6) screen:expect{grid=[[ {5:┌────────────────────┐} | {0:~ }{5:│}{1:^foo }{5:│}{0: }| @@ -7056,7 +7056,7 @@ describe('float window', function() | ]]} - meths.nvim_input_mouse('left', 'drag', '', 0, 2, 8) + api.nvim_input_mouse('left', 'drag', '', 0, 2, 8) screen:expect{grid=[[ {5:┌────────────────────┐} | {0:~ }{5:│}{27:foo}{1: }{5:│}{0: }| @@ -7070,10 +7070,10 @@ describe('float window', function() end) it("left drag changes visual selection in float window with winbar", function() - local buf = meths.nvim_create_buf(false,false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) - local float_win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=4, row=1, col=5}) - meths.nvim_set_option_value('winbar', 'floaty bar', {win=float_win.id}) + local buf = api.nvim_create_buf(false,false) + api.nvim_buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) + local float_win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=4, row=1, col=5}) + api.nvim_set_option_value('winbar', 'floaty bar', {win=float_win.id}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7096,7 +7096,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} - meths.nvim_input_mouse('left', 'press', '', 4, 1, 0) + api.nvim_input_mouse('left', 'press', '', 4, 1, 0) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -7118,7 +7118,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} - meths.nvim_input_mouse('left', 'drag', '', 4, 2, 2) + api.nvim_input_mouse('left', 'drag', '', 4, 2, 2) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -7150,7 +7150,7 @@ describe('float window', function() | ]]} - meths.nvim_input_mouse('left', 'press', '', 0, 2, 5) + api.nvim_input_mouse('left', 'press', '', 0, 2, 5) screen:expect{grid=[[ | {0:~ }{3:floaty bar }{0: }| @@ -7161,7 +7161,7 @@ describe('float window', function() | ]]} - meths.nvim_input_mouse('left', 'drag', '', 0, 3, 7) + api.nvim_input_mouse('left', 'drag', '', 0, 3, 7) screen:expect{grid=[[ | {0:~ }{3:floaty bar }{0: }| @@ -7175,9 +7175,9 @@ describe('float window', function() end) it('left drag changes visual selection if float window is turned into a split', function() - local buf = meths.nvim_create_buf(false,false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) - meths.nvim_open_win(buf, true, {relative='editor', width=20, height=3, row=2, col=5}) + local buf = api.nvim_create_buf(false,false) + api.nvim_buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) + api.nvim_open_win(buf, true, {relative='editor', width=20, height=3, row=2, col=5}) command('wincmd L') if multigrid then screen:expect([[ @@ -7197,7 +7197,7 @@ describe('float window', function() {0:~ }|*2 ]]) - meths.nvim_input_mouse('left', 'press', '', 4, 2, 2) + api.nvim_input_mouse('left', 'press', '', 4, 2, 2) screen:expect([[ ## grid 1 [2:-------------------]{5:│}[4:--------------------]|*5 @@ -7215,7 +7215,7 @@ describe('float window', function() {0:~ }|*2 ]]) - meths.nvim_input_mouse('left', 'drag', '', 4, 1, 1) + api.nvim_input_mouse('left', 'drag', '', 4, 1, 1) screen:expect([[ ## grid 1 [2:-------------------]{5:│}[4:--------------------]|*5 @@ -7242,7 +7242,7 @@ describe('float window', function() | ]]) - meths.nvim_input_mouse('left', 'press', '', 0, 2, 22) + api.nvim_input_mouse('left', 'press', '', 0, 2, 22) screen:expect([[ {5:│}foo | {0:~ }{5:│}bar | @@ -7252,7 +7252,7 @@ describe('float window', function() | ]]) - meths.nvim_input_mouse('left', 'drag', '', 0, 1, 21) + api.nvim_input_mouse('left', 'drag', '', 0, 1, 21) screen:expect([[ {5:│}foo | {0:~ }{5:│}b^a{27:r} | @@ -7265,9 +7265,9 @@ describe('float window', function() end) it('left click sets correct curswant in float window with border', function() - local buf = meths.nvim_create_buf(false,false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'', '', ''}) - meths.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=0, col=5, border='single'}) + local buf = api.nvim_create_buf(false,false) + api.nvim_buf_set_lines(buf, 0, -1, true, {'', '', ''}) + api.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=0, col=5, border='single'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7299,25 +7299,25 @@ describe('float window', function() end if multigrid then - meths.nvim_input_mouse('left', 'press', '', 4, 3, 1) + api.nvim_input_mouse('left', 'press', '', 4, 3, 1) else - meths.nvim_input_mouse('left', 'press', '', 0, 3, 6) + api.nvim_input_mouse('left', 'press', '', 0, 3, 6) end - eq({0, 3, 1, 0, 1}, funcs.getcurpos()) + eq({0, 3, 1, 0, 1}, fn.getcurpos()) if multigrid then - meths.nvim_input_mouse('left', 'press', '', 4, 3, 2) + api.nvim_input_mouse('left', 'press', '', 4, 3, 2) else - meths.nvim_input_mouse('left', 'press', '', 0, 3, 7) + api.nvim_input_mouse('left', 'press', '', 0, 3, 7) end - eq({0, 3, 1, 0, 2}, funcs.getcurpos()) + eq({0, 3, 1, 0, 2}, fn.getcurpos()) if multigrid then - meths.nvim_input_mouse('left', 'press', '', 4, 3, 10) + api.nvim_input_mouse('left', 'press', '', 4, 3, 10) else - meths.nvim_input_mouse('left', 'press', '', 0, 3, 15) + api.nvim_input_mouse('left', 'press', '', 0, 3, 15) end - eq({0, 3, 1, 0, 10}, funcs.getcurpos()) + eq({0, 3, 1, 0, 10}, fn.getcurpos()) command('setlocal foldcolumn=1') feed('zfkgg') @@ -7356,7 +7356,7 @@ describe('float window', function() end if multigrid then - meths.nvim_input_mouse('left', 'press', '', 4, 2, 1) + api.nvim_input_mouse('left', 'press', '', 4, 2, 1) screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]|*6 @@ -7379,7 +7379,7 @@ describe('float window', function() [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} else - meths.nvim_input_mouse('left', 'press', '', 0, 2, 6) + api.nvim_input_mouse('left', 'press', '', 0, 2, 6) screen:expect{grid=[[ {5:┌────────────────────┐} | {0:~ }{5:│}{19: }{1:^ }{5:│}{0: }| @@ -7392,25 +7392,25 @@ describe('float window', function() end if multigrid then - meths.nvim_input_mouse('left', 'press', '', 4, 2, 2) + api.nvim_input_mouse('left', 'press', '', 4, 2, 2) else - meths.nvim_input_mouse('left', 'press', '', 0, 2, 7) + api.nvim_input_mouse('left', 'press', '', 0, 2, 7) end - eq({0, 2, 1, 0, 1}, funcs.getcurpos()) + eq({0, 2, 1, 0, 1}, fn.getcurpos()) if multigrid then - meths.nvim_input_mouse('left', 'press', '', 4, 2, 3) + api.nvim_input_mouse('left', 'press', '', 4, 2, 3) else - meths.nvim_input_mouse('left', 'press', '', 0, 2, 8) + api.nvim_input_mouse('left', 'press', '', 0, 2, 8) end - eq({0, 2, 1, 0, 2}, funcs.getcurpos()) + eq({0, 2, 1, 0, 2}, fn.getcurpos()) if multigrid then - meths.nvim_input_mouse('left', 'press', '', 4, 2, 11) + api.nvim_input_mouse('left', 'press', '', 4, 2, 11) else - meths.nvim_input_mouse('left', 'press', '', 0, 2, 16) + api.nvim_input_mouse('left', 'press', '', 0, 2, 16) end - eq({0, 2, 1, 0, 10}, funcs.getcurpos()) + eq({0, 2, 1, 0, 10}, fn.getcurpos()) end) it("'winblend' option", function() @@ -7454,9 +7454,9 @@ describe('float window', function() occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]) - local buf = meths.nvim_create_buf(false,false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {"test", "", "popup text"}) - local win = meths.nvim_open_win(buf, false, {relative='editor', width=15, height=3, row=2, col=5}) + local buf = api.nvim_create_buf(false,false) + api.nvim_buf_set_lines(buf, 0, -1, true, {"test", "", "popup text"}) + local win = api.nvim_open_win(buf, false, {relative='editor', width=15, height=3, row=2, col=5}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7492,7 +7492,7 @@ describe('float window', function() ]]) end - meths.nvim_set_option_value("winblend", 30, {win=win.id}) + api.nvim_set_option_value("winblend", 30, {win=win.id}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7529,7 +7529,7 @@ describe('float window', function() end -- Check that 'winblend' works with NormalNC highlight - meths.nvim_set_option_value('winhighlight', 'NormalNC:Visual', {win = win}) + api.nvim_set_option_value('winhighlight', 'NormalNC:Visual', {win = win}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7574,7 +7574,7 @@ describe('float window', function() command('hi clear NormalNC') command('hi SpecialRegion guifg=Red blend=0') - meths.nvim_buf_add_highlight(buf, -1, "SpecialRegion", 2, 0, -1) + api.nvim_buf_add_highlight(buf, -1, "SpecialRegion", 2, 0, -1) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7648,7 +7648,7 @@ describe('float window', function() -- Test scrolling by mouse if multigrid then - meths.nvim_input_mouse('wheel', 'down', '', 4, 2, 2) + api.nvim_input_mouse('wheel', 'down', '', 4, 2, 2) screen:expect{grid=[[ ## grid 1 [2:--------------------------------------------------]|*8 @@ -7669,7 +7669,7 @@ describe('float window', function() {12:~ }|*2 ]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}} else - meths.nvim_input_mouse('wheel', 'down', '', 0, 4, 7) + api.nvim_input_mouse('wheel', 'down', '', 0, 4, 7) screen:expect([[ Ut enim ad minim veniam, quis nostrud | exercitation ullamco laboris nisi ut aliquip ex | @@ -7684,9 +7684,9 @@ describe('float window', function() end -- Check that 'winblend' applies to border/title/footer - meths.nvim_win_set_config(win, {border='single', title='Title', footer='Footer'}) - meths.nvim_set_option_value('winblend', 100, {win=win.id}) - meths.nvim_set_option_value("cursorline", true, {win=0}) + api.nvim_win_set_config(win, {border='single', title='Title', footer='Footer'}) + api.nvim_set_option_value('winblend', 100, {win=win.id}) + api.nvim_set_option_value("cursorline", true, {win=0}) command('hi clear VertSplit') feed('k0') if multigrid then @@ -7730,9 +7730,9 @@ describe('float window', function() insert([[ # TODO: 测试字典信息的准确性 # FIXME: 测试字典信息的准确性]]) - local buf = meths.nvim_create_buf(false,false) - meths.nvim_buf_set_lines(buf, 0, -1, true, {'口', '口'}) - local win = meths.nvim_open_win(buf, false, {relative='editor', width=5, height=3, row=0, col=11, style='minimal'}) + local buf = api.nvim_create_buf(false,false) + api.nvim_buf_set_lines(buf, 0, -1, true, {'口', '口'}) + local win = api.nvim_open_win(buf, false, {relative='editor', width=5, height=3, row=0, col=11, style='minimal'}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7758,7 +7758,7 @@ describe('float window', function() ]]) end - meths.nvim_win_close(win, false) + api.nvim_win_close(win, false) if multigrid then screen:expect([[ ## grid 1 @@ -7783,9 +7783,9 @@ describe('float window', function() -- The interaction between 'winblend' and doublewidth chars in the background -- does not look very good. But check no chars get incorrectly placed -- at least. Also check invisible EndOfBuffer region blends correctly. - meths.nvim_buf_set_lines(buf, 0, -1, true, {" x x x xx", " x x x x"}) - win = meths.nvim_open_win(buf, false, {relative='editor', width=12, height=3, row=0, col=11, style='minimal'}) - meths.nvim_set_option_value('winblend', 30, {win=win.id}) + api.nvim_buf_set_lines(buf, 0, -1, true, {" x x x xx", " x x x x"}) + win = api.nvim_open_win(buf, false, {relative='editor', width=12, height=3, row=0, col=11, style='minimal'}) + api.nvim_set_option_value('winblend', 30, {win=win.id}) screen:set_default_attr_ids({ [1] = {foreground = tonumber('0xb282b2'), background = tonumber('0xffcfff')}, [2] = {foreground = Screen.colors.Grey0, background = tonumber('0xffcfff')}, @@ -7821,7 +7821,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {relative='editor', row=0, col=12}) + api.nvim_win_set_config(win, {relative='editor', row=0, col=12}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7975,9 +7975,9 @@ describe('float window', function() end) it("correctly orders multiple opened floats (current last)", function() - local buf = meths.nvim_create_buf(false,false) - local win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) - meths.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win.id}) + local buf = api.nvim_create_buf(false,false) + local win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) + api.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win.id}) if multigrid then screen:expect{grid=[[ @@ -8061,9 +8061,9 @@ describe('float window', function() end) it("correctly orders multiple opened floats (non-current last)", function() - local buf = meths.nvim_create_buf(false,false) - local win = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) - meths.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win.id}) + local buf = api.nvim_create_buf(false,false) + local win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) + api.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win.id}) if multigrid then screen:expect{grid=[[ @@ -8147,13 +8147,13 @@ describe('float window', function() end) it('can use z-index', function() - local buf = meths.nvim_create_buf(false,false) - local win1 = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=1, col=5, zindex=30}) - meths.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win1.id}) - local win2 = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=2, col=6, zindex=50}) - meths.nvim_set_option_value("winhl", "Normal:Search,EndOfBuffer:Search", {win=win2.id}) - local win3 = meths.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=3, col=7, zindex=40}) - meths.nvim_set_option_value("winhl", "Normal:Question,EndOfBuffer:Question", {win=win3.id}) + local buf = api.nvim_create_buf(false,false) + local win1 = api.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=1, col=5, zindex=30}) + api.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win1.id}) + local win2 = api.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=2, col=6, zindex=50}) + api.nvim_set_option_value("winhl", "Normal:Search,EndOfBuffer:Search", {win=win2.id}) + local win3 = api.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=3, col=7, zindex=40}) + api.nvim_set_option_value("winhl", "Normal:Question,EndOfBuffer:Question", {win=win3.id}) if multigrid then screen:expect{grid=[[ @@ -8198,9 +8198,9 @@ describe('float window', function() end) it('can use winbar', function() - local buf = meths.nvim_create_buf(false,false) - local win1 = meths.nvim_open_win(buf, false, {relative='editor', width=15, height=3, row=1, col=5}) - meths.nvim_set_option_value('winbar', 'floaty bar', {win=win1.id}) + local buf = api.nvim_create_buf(false,false) + local win1 = api.nvim_open_win(buf, false, {relative='editor', width=15, height=3, row=1, col=5}) + api.nvim_set_option_value('winbar', 'floaty bar', {win=win1.id}) if multigrid then screen:expect{grid=[[ @@ -8234,7 +8234,7 @@ describe('float window', function() end -- resize and add a border - meths.nvim_win_set_config(win1, {relative='editor', width=15, height=4, row=0, col=4, border = 'single'}) + api.nvim_win_set_config(win1, {relative='editor', width=15, height=4, row=0, col=4, border = 'single'}) if multigrid then screen:expect{grid=[[ @@ -8273,8 +8273,8 @@ describe('float window', function() it('it can be resized with messages and cmdheight=0 #20106', function() screen:try_resize(40,9) command 'set cmdheight=0' - local buf = meths.nvim_create_buf(false,true) - local win = meths.nvim_open_win(buf, false, {relative='editor', width=40, height=4, anchor='SW', row=9, col=0, style='minimal', border="single", noautocmd=true}) + local buf = api.nvim_create_buf(false,true) + local win = api.nvim_open_win(buf, false, {relative='editor', width=40, height=4, anchor='SW', row=9, col=0, style='minimal', border="single", noautocmd=true}) if multigrid then screen:expect{grid=[[ @@ -8339,7 +8339,7 @@ describe('float window', function() end - meths.nvim_win_close(win, true) + api.nvim_win_close(win, true) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -8361,8 +8361,8 @@ describe('float window', function() it('it can be resized with messages and cmdheight=1', function() screen:try_resize(40,9) - local buf = meths.nvim_create_buf(false,true) - local win = meths.nvim_open_win(buf, false, {relative='editor', width=40, height=4, anchor='SW', row=8, col=0, style='minimal', border="single", noautocmd=true}) + local buf = api.nvim_create_buf(false,true) + local win = api.nvim_open_win(buf, false, {relative='editor', width=40, height=4, anchor='SW', row=8, col=0, style='minimal', border="single", noautocmd=true}) if multigrid then screen:expect{grid=[[ @@ -8469,7 +8469,7 @@ describe('float window', function() ]]} end - meths.nvim_win_close(win, true) + api.nvim_win_close(win, true) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -8495,7 +8495,7 @@ describe('float window', function() describe('no crash after moving and closing float window #21547', function() local function test_float_move_close(cmd) local float_opts = {relative = 'editor', row = 1, col = 1, width = 10, height = 10} - meths.nvim_open_win(meths.nvim_create_buf(false, false), true, float_opts) + api.nvim_open_win(api.nvim_create_buf(false, false), true, float_opts) if multigrid then screen:expect({float_pos = {[4] = {{id = 1001}, 'NW', 1, 1, 1, true}}}) end @@ -8522,7 +8522,7 @@ describe('float window', function() it(':sleep cursor placement #22639', function() local float_opts = {relative = 'editor', row = 1, col = 1, width = 4, height = 3} - local win = meths.nvim_open_win(meths.nvim_create_buf(false, false), true, float_opts) + local win = api.nvim_open_win(api.nvim_create_buf(false, false), true, float_opts) feed('iabcd') feed(':sleep 100') if multigrid then @@ -8590,7 +8590,7 @@ describe('float window', function() feed('') screen:expect_unchanged() - meths.nvim_win_set_config(win, {border = 'single'}) + api.nvim_win_set_config(win, {border = 'single'}) feed(':sleep 100') if multigrid then screen:expect{grid=[[ @@ -8739,7 +8739,7 @@ describe('float window', function() it('with rightleft and border #22640', function() local float_opts = {relative='editor', width=5, height=3, row=1, col=1, border='single'} - meths.nvim_open_win(meths.nvim_create_buf(false, false), true, float_opts) + api.nvim_open_win(api.nvim_create_buf(false, false), true, float_opts) command('setlocal rightleft') feed('iabcdef') if multigrid then @@ -8778,8 +8778,8 @@ describe('float window', function() end) it('float window with hide option', function() - local buf = meths.nvim_create_buf(false,false) - local win = meths.nvim_open_win(buf, false, {relative='editor', width=10, height=2, row=2, col=5, hide = true}) + local buf = api.nvim_create_buf(false,false) + local win = api.nvim_open_win(buf, false, {relative='editor', width=10, height=2, row=2, col=5, hide = true}) local expected_pos = { [4]={{id=1001}, 'NW', 1, 2, 5, true}, } @@ -8807,7 +8807,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {hide = false}) + api.nvim_win_set_config(win, {hide = false}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -8834,7 +8834,7 @@ describe('float window', function() ]]) end - meths.nvim_win_set_config(win, {hide=true}) + api.nvim_win_set_config(win, {hide=true}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -8860,18 +8860,18 @@ describe('float window', function() end) it(':fclose command #9663', function() - local buf_a = meths.nvim_create_buf(false,false) - local buf_b = meths.nvim_create_buf(false,false) - local buf_c = meths.nvim_create_buf(false,false) - local buf_d = meths.nvim_create_buf(false,false) + local buf_a = api.nvim_create_buf(false,false) + local buf_b = api.nvim_create_buf(false,false) + local buf_c = api.nvim_create_buf(false,false) + local buf_d = api.nvim_create_buf(false,false) local config_a = {relative='editor', width=11, height=11, row=5, col=5, border ='single', zindex=50} local config_b = {relative='editor', width=8, height=8, row=7, col=7, border ='single', zindex=70} local config_c = {relative='editor', width=4, height=4, row=9, col=9, border ='single',zindex=90} local config_d = {relative='editor', width=2, height=2, row=10, col=10, border ='single',zindex=100} - meths.nvim_open_win(buf_a, false, config_a) - meths.nvim_open_win(buf_b, false, config_b) - meths.nvim_open_win(buf_c, false, config_c) - meths.nvim_open_win(buf_d, false, config_d) + api.nvim_open_win(buf_a, false, config_a) + api.nvim_open_win(buf_b, false, config_b) + api.nvim_open_win(buf_c, false, config_c) + api.nvim_open_win(buf_d, false, config_d) local expected_pos = { [4]={{id=1001}, 'NW', 1, 5, 5, true, 50}, [5]={{id=1002}, 'NW', 1, 7, 7, true, 70}, -- cgit From 8f02ae82e203920b472d17e75a61763f3a409a7b Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Tue, 16 Jan 2024 13:26:21 +0000 Subject: test: use integers for API Buffer/Window/Tabpage EXT types --- test/functional/ui/float_spec.lua | 762 +++++++++++++++++++------------------- 1 file changed, 379 insertions(+), 383 deletions(-) (limited to 'test/functional/ui/float_spec.lua') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index d08e346fc2..b05e7aceda 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -47,8 +47,8 @@ describe('float window', function() local win = api.nvim_open_win(buf, false, {relative='win', width=16, height=1, row=0, col=10}) local line = fn.win_execute(win, 'echo getline(1)') eq('\nthe floatwin', line) - eq('\n1', fn.win_execute(win, 'echo line(".",'..win.id..')')) - eq('\n3', fn.win_execute(win, 'echo line("$",'..win.id..')')) + eq('\n1', fn.win_execute(win, 'echo line(".",'..win..')')) + eq('\n3', fn.win_execute(win, 'echo line("$",'..win..')')) eq('\n0', fn.win_execute(win, 'echo line("$", 123456)')) fn.win_execute(win, 'bwipe!') end) @@ -480,7 +480,7 @@ describe('float window', function() it('no crash with bufpos and non-existent window', function() command('new') - local closed_win = api.nvim_get_current_win().id + local closed_win = api.nvim_get_current_win() command('close') local buf = api.nvim_create_buf(false,false) api.nvim_open_win(buf, true, {relative='win', win=closed_win, width=1, height=1, bufpos={0,0}}) @@ -490,7 +490,7 @@ describe('float window', function() it("no segfault when setting minimal style after clearing local 'fillchars' #19510", function() local float_opts = {relative = 'editor', row = 1, col = 1, width = 1, height = 1} local float_win = api.nvim_open_win(0, true, float_opts) - api.nvim_set_option_value('fillchars', NIL, {win=float_win.id}) + api.nvim_set_option_value('fillchars', NIL, {win=float_win}) float_opts.style = 'minimal' api.nvim_win_set_config(float_win, float_opts) assert_alive() @@ -519,7 +519,7 @@ describe('float window', function() api.nvim_set_option_value('splitkeep', 'screen', {}) local float_opts = {relative = 'editor', row = 1, col = 1, width = 10, height = 10} local float_win = api.nvim_open_win(0, true, float_opts) - eq(5, api.nvim_get_option_value('scroll', {win=float_win.id})) + eq(5, api.nvim_get_option_value('scroll', {win=float_win})) end) it(':unhide works when there are floating windows', function() @@ -548,8 +548,8 @@ describe('float window', function() local old_buf, old_win before_each(function() insert('foo') - old_buf = curbuf().id - old_win = curwin().id + old_buf = curbuf() + old_win = curwin() end) describe('closing the last non-floating window gives E444', function() before_each(function() @@ -569,10 +569,10 @@ describe('float window', function() describe('leaves one window with an empty buffer when there is only one buffer', function() local same_buf_float before_each(function() - same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id + same_buf_float = api.nvim_open_win(old_buf, false, float_opts) end) after_each(function() - eq(old_win, curwin().id) + eq(old_win, curwin()) expect('') eq(1, #api.nvim_list_wins()) end) @@ -591,20 +591,20 @@ describe('float window', function() describe('closes other windows with that buffer when there are other buffers', function() local same_buf_float, other_buf, other_buf_float before_each(function() - same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id - other_buf = api.nvim_create_buf(true, false).id - other_buf_float = api.nvim_open_win(other_buf, true, float_opts).id + same_buf_float = api.nvim_open_win(old_buf, false, float_opts) + other_buf = api.nvim_create_buf(true, false) + other_buf_float = api.nvim_open_win(other_buf, true, float_opts) insert('bar') api.nvim_set_current_win(old_win) end) after_each(function() - eq(other_buf, curbuf().id) + eq(other_buf, curbuf()) expect('bar') eq(2, #api.nvim_list_wins()) end) it('if called from non-floating window', function() api.nvim_buf_delete(old_buf, {force = true}) - eq(old_win, curwin().id) + eq(old_win, curwin()) end) it('if called from floating window with the same buffer', function() api.nvim_set_current_win(same_buf_float) @@ -613,7 +613,7 @@ describe('float window', function() api.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, eval('g:win_leave')) eq(old_win, eval('g:win_enter')) - eq(old_win, curwin().id) + eq(old_win, curwin()) end) -- TODO: this case is too hard to deal with pending('if called from floating window with another buffer', function() @@ -624,9 +624,9 @@ describe('float window', function() describe('creates an empty buffer when there is only one listed buffer', function() local same_buf_float, unlisted_buf_float before_each(function() - same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id - local unlisted_buf = api.nvim_create_buf(true, false).id - unlisted_buf_float = api.nvim_open_win(unlisted_buf, true, float_opts).id + same_buf_float = api.nvim_open_win(old_buf, false, float_opts) + local unlisted_buf = api.nvim_create_buf(true, false) + unlisted_buf_float = api.nvim_open_win(unlisted_buf, true, float_opts) insert('unlisted') command('set nobuflisted') api.nvim_set_current_win(old_win) @@ -637,7 +637,7 @@ describe('float window', function() end) it('if called from non-floating window', function() api.nvim_buf_delete(old_buf, {force = true}) - eq(old_win, curwin().id) + eq(old_win, curwin()) end) it('if called from floating window with the same buffer', function() api.nvim_set_current_win(same_buf_float) @@ -646,7 +646,7 @@ describe('float window', function() api.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, eval('g:win_leave')) eq(old_win, eval('g:win_enter')) - eq(old_win, curwin().id) + eq(old_win, curwin()) end) -- TODO: this case is too hard to deal with pending('if called from floating window with an unlisted buffer', function() @@ -663,7 +663,7 @@ describe('float window', function() insert('unlisted') command('set nobuflisted') api.nvim_set_current_win(old_win) - same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id + same_buf_float = api.nvim_open_win(old_buf, false, float_opts) end) after_each(function() expect('') @@ -671,12 +671,12 @@ describe('float window', function() end) it('if called from non-floating window with the deleted buffer', function() api.nvim_buf_delete(old_buf, {force = true}) - eq(old_win, curwin().id) + eq(old_win, curwin()) end) it('if called from floating window with the deleted buffer', function() api.nvim_set_current_win(same_buf_float) api.nvim_buf_delete(old_buf, {force = true}) - eq(same_buf_float, curwin().id) + eq(same_buf_float, curwin()) end) end) end) @@ -688,17 +688,17 @@ describe('float window', function() before_each(function() insert('unlisted') command('set nobuflisted') - unlisted_buf = curbuf().id + unlisted_buf = curbuf() command('tabnew') insert('foo') - old_buf = curbuf().id - old_win = curwin().id + old_buf = curbuf() + old_win = curwin() end) describe('without splits, deleting the last listed buffer creates an empty buffer', function() local same_buf_float before_each(function() api.nvim_set_current_win(old_win) - same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id + same_buf_float = api.nvim_open_win(old_buf, false, float_opts) end) after_each(function() expect('') @@ -707,7 +707,7 @@ describe('float window', function() end) it('if called from non-floating window', function() api.nvim_buf_delete(old_buf, {force = true}) - eq(old_win, curwin().id) + eq(old_win, curwin()) end) it('if called from non-floating window in another tabpage', function() command('tab split') @@ -721,7 +721,7 @@ describe('float window', function() api.nvim_buf_delete(old_buf, {force = true}) eq(same_buf_float, eval('g:win_leave')) eq(old_win, eval('g:win_enter')) - eq(old_win, curwin().id) + eq(old_win, curwin()) end) end) describe('with splits, deleting the last listed buffer creates an empty buffer', function() @@ -730,7 +730,7 @@ describe('float window', function() command('botright vsplit') api.nvim_set_current_buf(unlisted_buf) api.nvim_set_current_win(old_win) - same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id + same_buf_float = api.nvim_open_win(old_buf, false, float_opts) end) after_each(function() expect('') @@ -739,12 +739,12 @@ describe('float window', function() end) it('if called from non-floating window with the deleted buffer', function() api.nvim_buf_delete(old_buf, {force = true}) - eq(old_win, curwin().id) + eq(old_win, curwin()) end) it('if called from floating window with the deleted buffer', function() api.nvim_set_current_win(same_buf_float) api.nvim_buf_delete(old_buf, {force = true}) - eq(same_buf_float, curwin().id) + eq(same_buf_float, curwin()) end) end) end) @@ -753,20 +753,20 @@ describe('float window', function() local float_opts = {relative = 'editor', row = 1, col = 1, width = 1, height = 1} local old_tabpage, old_buf, old_win before_each(function() - old_tabpage = curtab().id + old_tabpage = curtab() insert('oldtab') command('tabnew') - old_buf = curbuf().id - old_win = curwin().id + old_buf = curbuf() + old_win = curwin() end) describe('closing the last non-floating window', function() describe('closes the tabpage when all floating windows are closeable', function() local same_buf_float before_each(function() - same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id + same_buf_float = api.nvim_open_win(old_buf, false, float_opts) end) after_each(function() - eq(old_tabpage, curtab().id) + eq(old_tabpage, curtab()) expect('oldtab') eq(1, #api.nvim_list_tabpages()) end) @@ -782,8 +782,8 @@ describe('float window', function() local other_buf_float before_each(function() command('set nohidden') - local other_buf = api.nvim_create_buf(true, false).id - other_buf_float = api.nvim_open_win(other_buf, true, float_opts).id + local other_buf = api.nvim_create_buf(true, false) + other_buf_float = api.nvim_open_win(other_buf, true, float_opts) insert('foo') api.nvim_set_current_win(old_win) end) @@ -802,13 +802,13 @@ describe('float window', function() describe('closes the tabpage when all floating windows are closeable', function() local same_buf_float, other_buf, other_buf_float before_each(function() - same_buf_float = api.nvim_open_win(old_buf, false, float_opts).id - other_buf = api.nvim_create_buf(true, false).id - other_buf_float = api.nvim_open_win(other_buf, true, float_opts).id + same_buf_float = api.nvim_open_win(old_buf, false, float_opts) + other_buf = api.nvim_create_buf(true, false) + other_buf_float = api.nvim_open_win(other_buf, true, float_opts) api.nvim_set_current_win(old_win) end) after_each(function() - eq(old_tabpage, curtab().id) + eq(old_tabpage, curtab()) expect('oldtab') eq(1, #api.nvim_list_tabpages()) end) @@ -872,7 +872,7 @@ describe('float window', function() local buf = api.nvim_create_buf(false,false) local win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) local expected_pos = { - [4]={{id=1001}, 'NW', 1, 2, 5, true}, + [4]={1001, 'NW', 1, 2, 5, true}, } if multigrid then @@ -972,7 +972,7 @@ describe('float window', function() {1: }| {2:~ }| ]], float_pos={ - [5] = {{id = 1002}, "NW", 4, 2, 10, true}; + [5] = {1002, "NW", 4, 2, 10, true}; }} else screen:expect([[ @@ -1013,7 +1013,7 @@ describe('float window', function() local buf = api.nvim_create_buf(false,false) local win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) local expected_pos = { - [4]={{id=1001}, 'NW', 1, 2, 5, true}, + [4]={1001, 'NW', 1, 2, 5, true}, } if multigrid then @@ -1125,7 +1125,7 @@ describe('float window', function() {18: 2 }{15:y }| {18: 3 }{15: }| {16:~ }| - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 4, 10, true}}} else screen:expect([[ {14: 1 }^x | @@ -1155,7 +1155,7 @@ describe('float window', function() ## grid 4 {18: 1 }{15: }| {16:~ }|*3 - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 4, 10, true}}} else screen:expect([[ {14: 1 }^x | @@ -1192,7 +1192,7 @@ describe('float window', function() {15:x }| {15:y }| {15: }|*2 - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 4, 10, true}}} else screen:expect{grid=[[ {19: }{20: 1 }{22:^x}{21: }| @@ -1224,7 +1224,7 @@ describe('float window', function() {19: }{15:y }| {19: }{15: }| {15: }| - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 4, 10, true}}} else screen:expect([[ @@ -1255,7 +1255,7 @@ describe('float window', function() | ## grid 4 {15: }|*4 - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 4, 10, true}}} else screen:expect([[ {19: }{20: 1 }{22:^x}{21: }| @@ -1292,7 +1292,7 @@ describe('float window', function() {15:x }| {15:y }| {15: }|*2 - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 4, 10, true}}} else screen:expect{grid=[[ {19: }{20: 1 }{22:^x}{21: }| @@ -1324,7 +1324,7 @@ describe('float window', function() {19: }{15:y }| {19: }{15: }| {15: }| - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 4, 10, true}}} else screen:expect([[ @@ -1355,7 +1355,7 @@ describe('float window', function() | ## grid 4 {15: }|*4 - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 4, 10, true}}} else screen:expect([[ {19: }{20: 1 }{22:^x}{21: }| @@ -1393,7 +1393,7 @@ describe('float window', function() {15:x }| {15:y }| {15: }|*2 - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 4, 10, true}}} else screen:expect{grid=[[ {20:1}{19: }{20: }{22:^x}{21: }| @@ -1428,10 +1428,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═════════╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -1462,10 +1462,10 @@ describe('float window', function() {5:│}{1: BORDAA }{5:│}| {5:└─────────┘}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -1496,10 +1496,10 @@ describe('float window', function() {5:│}{1: BORDAA }{5:│}| {5:╰─────────╯}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -1530,10 +1530,10 @@ describe('float window', function() {5: }{1: BORDAA }{5: }| {5: }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -1565,10 +1565,10 @@ describe('float window', function() {17:n̈̊}{1: BORDAA }{17:n̈̊}| {5:\}{7:ååååååååå}{5:x}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -1597,10 +1597,10 @@ describe('float window', function() {1: halloj! }| {1: BORDAA }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -1628,10 +1628,10 @@ describe('float window', function() {5:<}{1: halloj! }{5:>}| {5:<}{1: BORDAA }{5:>}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -1661,10 +1661,10 @@ describe('float window', function() {1: BORDAA }| {5:---------}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -1706,10 +1706,10 @@ describe('float window', function() {1: BORDAA }{26: }| {25: }{26: }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 6, curline = 5, curcol = 0, linecount = 6, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 6, curline = 5, curcol = 0, linecount = 6, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -1817,10 +1817,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═════════╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -1863,10 +1863,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═════════╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -1897,10 +1897,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═════════╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -1931,10 +1931,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═════════╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -1965,10 +1965,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═════════╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2008,10 +2008,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚}{11:Left}{5:═════╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2042,10 +2042,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═}{11:Center}{5:══╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2076,10 +2076,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚════}{11:Right}{5:╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2110,10 +2110,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═════}🦄BB{5:╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2153,10 +2153,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚════}{11:Right}{5:╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2187,10 +2187,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═}{11:Center}{5:══╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2221,10 +2221,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚}{11:Left}{5:═════╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2260,10 +2260,10 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═════}🦄{7:BB}{5:╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true } + [4] = { 1001, "NW", 1, 2, 5, true } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2297,10 +2297,10 @@ describe('float window', function() {5:│}{2:~ }{5:│}|*6 {5:└────────────────────────────────────────┘}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 0, 0, true, 201 } + [4] = { 1001, "NW", 1, 0, 0, true, 201 } }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2337,10 +2337,10 @@ describe('float window', function() {5:║}{1:^ }{5:║}| {5:╚═════════╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 0, 5, true }; + [4] = { 1001, "NW", 1, 0, 5, true }; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 2, curcol = 0, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 2, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2377,11 +2377,11 @@ describe('float window', function() {1: abb }| {13: acc }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 0, 5, true, 50 }; - [5] = { { id = -1 }, "NW", 4, 4, 0, false, 100 }; + [4] = { 1001, "NW", 1, 0, 5, true, 50 }; + [5] = { -1, "NW", 4, 4, 0, false, 100 }; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount=1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 2, curcol = 3, linecount=3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount=1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 2, curcol = 3, linecount=3, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2416,10 +2416,10 @@ describe('float window', function() {5:║}{1:ac^c }{5:║}| {5:╚═════════╝}| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 0, 5, true }; + [4] = { 1001, "NW", 1, 0, 5, true }; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 2, curcol = 2, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 2, curcol = 2, linecount = 3, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2460,11 +2460,11 @@ describe('float window', function() {1: bar }| {1: baz }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 0, 5, true }; - [5] = { { id = -1 }, "NW", 4, 4, 2, false, 250 }; + [4] = { 1001, "NW", 1, 0, 5, true }; + [5] = { -1, "NW", 4, 4, 2, false, 250 }; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 2, curcol = 2, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 2, curcol = 2, linecount = 3, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2504,10 +2504,10 @@ describe('float window', function() {1:abb acc }| {2:~ }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 0, 5, true, 50}; + [4] = {1001, "NW", 1, 0, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2535,10 +2535,10 @@ describe('float window', function() {1:abb acc }| {2:~ }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 0, 5, true, 50}; + [4] = {1001, "NW", 1, 0, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 4, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 0, curcol = 4, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2568,10 +2568,10 @@ describe('float window', function() {1:^ }| {2:~ }|*2 ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 0, 5, true, 50}; + [4] = {1001, "NW", 1, 0, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2608,12 +2608,12 @@ describe('float window', function() {1:^ }| {2:~ }|*2 ]], float_pos={ - [5] = {{id = 1002}, "NW", 1, 0, 5, true, 50}; - [4] = {{id = 1001}, "NW", 1, 0, 0, true, 50}; + [5] = {1002, "NW", 1, 0, 5, true, 50}; + [4] = {1001, "NW", 1, 0, 0, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [5] = {win = {id = 1002}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [5] = {win = 1002, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2641,12 +2641,12 @@ describe('float window', function() {1:^ }| {2:~ }|*2 ]], float_pos={ - [5] = {{id = 1002}, "NW", 1, 0, 5, true, 50}; - [4] = {{id = 1001}, "NW", 1, 0, 0, true, 50}; + [5] = {1002, "NW", 1, 0, 5, true, 50}; + [4] = {1001, "NW", 1, 0, 0, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [5] = {win = {id = 1002}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [5] = {win = 1002, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2676,7 +2676,7 @@ describe('float window', function() ## grid 4 {1:x}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 2, 0, 4, false} + [4] = {1001, "NW", 2, 0, 4, false} }} else screen:expect([[ @@ -2700,7 +2700,7 @@ describe('float window', function() ## grid 4 {1:x}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 2, 0, 15, false} + [4] = {1001, "NW", 2, 0, 15, false} }} else screen:expect([[ @@ -2780,15 +2780,15 @@ describe('float window', function() ^ | {0:~ }| ]], float_pos={ - [5] = {{id = 1002}, "NW", 1, 6, 0, true, 50}; - [6] = {{id = 1003}, "NW", 1, 6, 0, true, 50}; + [5] = {1002, "NW", 1, 6, 0, true, 50}; + [6] = {1003, "NW", 1, 6, 0, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [5] = {win = {id = 1002}, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [6] = {win = {id = 1003}, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [7] = {win = {id = 1004}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [8] = {win = {id = 1005}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [5] = {win = 1002, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [6] = {win = 1003, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [7] = {win = 1004, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [8] = {win = 1005, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2840,12 +2840,12 @@ describe('float window', function() ## grid 10 | ]], win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [7] = {win = {id = 1004}, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [8] = {win = {id = 1005}, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [9] = {win = {id = 1006}, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [10] = {win = {id = 1007}, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [7] = {win = 1004, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [8] = {win = 1005, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [9] = {win = 1006, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [10] = {win = 1007, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -2965,7 +2965,7 @@ describe('float window', function() {1: }| {2:~ }| ]], float_pos={ - [5] = {{id = 1002}, "NW", 4, 0, 10, true} + [5] = {1002, "NW", 4, 0, 10, true} }} else screen:expect([[ @@ -3004,7 +3004,7 @@ describe('float window', function() {1: }| {2:~ }| ]], float_pos={ - [5] = {{id = 1002}, "NW", 4, 1, 1, true} + [5] = {1002, "NW", 4, 1, 1, true} }} else screen:expect([[ @@ -3043,7 +3043,7 @@ describe('float window', function() {1: }| {2:~ }| ]], float_pos={ - [5] = {{id = 1002}, "SW", 4, 0, 3, true} + [5] = {1002, "SW", 4, 0, 3, true} }} else screen:expect([[ @@ -3082,7 +3082,7 @@ describe('float window', function() {1: }| {2:~ }| ]], float_pos={ - [5] = {{id = 1002}, "NW", 2, 1, 10, true} + [5] = {1002, "NW", 2, 1, 10, true} }} else screen:expect([[ @@ -3121,7 +3121,7 @@ describe('float window', function() {1: }| {2:~ }| ]], float_pos={ - [5] = {{id = 1002}, "SE", 2, 3, 39, true} + [5] = {1002, "SE", 2, 3, 39, true} }} else screen:expect([[ @@ -3160,7 +3160,7 @@ describe('float window', function() {1: }| {2:~ }| ]], float_pos={ - [5] = {{id = 1002}, "NE", 4, 0, 50, true} + [5] = {1002, "NE", 4, 0, 50, true} }, win_viewport = { [2] = { topline = 0, @@ -3169,7 +3169,7 @@ describe('float window', function() curcol = 3, linecount = 2, sum_scroll_delta = 0, - win = { id = 1000 }, + win = 1000, }, [4] = { topline = 0, @@ -3178,7 +3178,7 @@ describe('float window', function() curcol = 3, linecount = 2, sum_scroll_delta = 0, - win = { id = 1001 } + win = 1001 }, [5] = { topline = 0, @@ -3187,7 +3187,7 @@ describe('float window', function() curcol = 0, linecount = 1, sum_scroll_delta = 0, - win = { id = 1002 } + win = 1002 } }} else @@ -3272,7 +3272,7 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═════════╝}| ]], float_pos={ - [5] = {{id = 1002}, "NW", 4, 1, 14, true} + [5] = {1002, "NW", 4, 1, 14, true} }} else screen:expect([[ @@ -3315,7 +3315,7 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═════════╝}| ]], float_pos={ - [5] = {{id = 1002}, "NE", 4, 0, 14, true} + [5] = {1002, "NE", 4, 0, 14, true} }} else screen:expect([[ @@ -3358,7 +3358,7 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═════════╝}| ]], float_pos={ - [5] = {{id = 1002}, "SE", 4, 1, 14, true} + [5] = {1002, "SE", 4, 1, 14, true} }} else screen:expect([[ @@ -3401,7 +3401,7 @@ describe('float window', function() {5:║}{1: BORDAA }{5:║}| {5:╚═════════╝}| ]], float_pos={ - [5] = {{id = 1002}, "SW", 4, 0, 14, true} + [5] = {1002, "SW", 4, 0, 14, true} }} else screen:expect([[ @@ -3485,14 +3485,14 @@ describe('float window', function() ## grid 12 {1:8 }| ]], float_pos={ - [5] = {{id = 1002}, "NW", 1, 1, 10, true, 50}; - [6] = {{id = 1003}, "NW", 1, 1, 30, true, 50}; - [7] = {{id = 1004}, "NE", 5, 1, 0, true, 50}; - [8] = {{id = 1005}, "NE", 6, 1, 0, true, 50}; - [9] = {{id = 1006}, "SE", 7, 0, 0, true, 50}; - [10] = {{id = 1007}, "SE", 8, 0, 0, true, 50}; - [11] = {{id = 1008}, "SW", 9, 0, 5, true, 50}; - [12] = {{id = 1009}, "SW", 10, 0, 5, true, 50}; + [5] = {1002, "NW", 1, 1, 10, true, 50}; + [6] = {1003, "NW", 1, 1, 30, true, 50}; + [7] = {1004, "NE", 5, 1, 0, true, 50}; + [8] = {1005, "NE", 6, 1, 0, true, 50}; + [9] = {1006, "SE", 7, 0, 0, true, 50}; + [10] = {1007, "SE", 8, 0, 0, true, 50}; + [11] = {1008, "SW", 9, 0, 5, true, 50}; + [12] = {1009, "SW", 10, 0, 5, true, 50}; }} else screen:expect([[ @@ -3552,14 +3552,14 @@ describe('float window', function() ## grid 12 {1:8 }| ]], float_pos={ - [5] = {{id = 1002}, "NE", 8, 1, 0, true, 50}; - [6] = {{id = 1003}, "NE", 12, 1, 0, true, 50}; - [7] = {{id = 1004}, "SE", 5, 0, 0, true, 50}; - [8] = {{id = 1005}, "NW", 1, 1, 30, true, 50}; - [9] = {{id = 1006}, "SW", 10, 0, 5, true, 50}; - [10] = {{id = 1007}, "SE", 6, 0, 0, true, 50}; - [11] = {{id = 1008}, "SW", 7, 0, 5, true, 50}; - [12] = {{id = 1009}, "NW", 1, 1, 10, true, 50}; + [5] = {1002, "NE", 8, 1, 0, true, 50}; + [6] = {1003, "NE", 12, 1, 0, true, 50}; + [7] = {1004, "SE", 5, 0, 0, true, 50}; + [8] = {1005, "NW", 1, 1, 30, true, 50}; + [9] = {1006, "SW", 10, 0, 5, true, 50}; + [10] = {1007, "SE", 6, 0, 0, true, 50}; + [11] = {1008, "SW", 7, 0, 5, true, 50}; + [12] = {1009, "NW", 1, 1, 10, true, 50}; }} else screen:expect([[ @@ -3596,7 +3596,7 @@ describe('float window', function() it('can be placed relative text in a window', function() screen:try_resize(30,5) - local firstwin = api.nvim_get_current_win().id + local firstwin = api.nvim_get_current_win() api.nvim_buf_set_lines(0, 0, -1, true, {'just some', 'example text that is wider than the window', '', '', 'more text'}) if multigrid then screen:expect{grid=[[ @@ -3639,7 +3639,7 @@ describe('float window', function() ## grid 4 {1:some info! }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 2, 3, 2, true } + [4] = { 1001, "NW", 2, 3, 2, true } }} else screen:expect{grid=[[ @@ -3668,7 +3668,7 @@ describe('float window', function() ## grid 4 {1:some info! }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 2, 2, 2, true }, + [4] = { 1001, "NW", 2, 2, 2, true }, }} else screen:expect{grid=[[ @@ -3695,7 +3695,7 @@ describe('float window', function() ## grid 4 {1:some info! }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 2, 1, 32, true } + [4] = { 1001, "NW", 2, 1, 32, true } }} else -- note: appears misaligned due to cursor @@ -3725,7 +3725,7 @@ describe('float window', function() ## grid 4 {1:some info! }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 2, 2, 7, true } + [4] = { 1001, "NW", 2, 2, 7, true } }} else screen:expect{grid=[[ @@ -3756,7 +3756,7 @@ describe('float window', function() ## grid 4 {1:some info! }| ]], float_pos={ - [4] = { { id = 1001 }, "SW", 2, 1, 7, true } + [4] = { 1001, "SW", 2, 1, 7, true } }} else screen:expect{grid=[[ @@ -3794,7 +3794,7 @@ describe('float window', function() ^ | {0:~ }|*8 ]], float_pos={ - [4] = { { id = 1001 }, "SW", 2, 8, 0, true } + [4] = { 1001, "SW", 2, 8, 0, true } }} else screen:expect{grid=[[ @@ -3829,7 +3829,7 @@ describe('float window', function() ## grid 4 {1:some info! }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 2, 2, 5, true } + [4] = { 1001, "NW", 2, 2, 5, true } }} else screen:expect{grid=[[ @@ -3860,7 +3860,7 @@ describe('float window', function() ## grid 4 {1:some info! }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 2, 3, 7, true } + [4] = { 1001, "NW", 2, 3, 7, true } }} else screen:expect{grid=[[ @@ -3888,7 +3888,7 @@ describe('float window', function() ## grid 4 {1:some info! }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 2, 2, 0, true } + [4] = { 1001, "NW", 2, 2, 0, true } }} else screen:expect{grid=[[ @@ -3940,7 +3940,7 @@ describe('float window', function() ## grid 4 {1:some floaty text }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 3, 1, true} + [4] = {1001, "NW", 1, 3, 1, true} }} else screen:expect([[ @@ -3962,7 +3962,7 @@ describe('float window', function() local buf = api.nvim_create_buf(false,false) api.nvim_open_win(buf, true, {relative='editor', width=20, height=2, row=2, col=5}) local expected_pos = { - [2]={{id=1001}, 'NW', 1, 2, 5} + [2]={1001, 'NW', 1, 2, 5} } screen:expect{grid=[[ ## grid 1 @@ -3990,7 +3990,7 @@ describe('float window', function() api.nvim_buf_set_lines(buf, 0, -1, true, {'such', 'very', 'float'}) local win = api.nvim_open_win(buf, false, {relative='editor', width=15, height=4, row=2, col=10}) local expected_pos = { - [4]={{id=1001}, 'NW', 1, 2, 10, true}, + [4]={1001, 'NW', 1, 2, 10, true}, } if multigrid then screen:expect{grid=[[ @@ -4430,7 +4430,7 @@ describe('float window', function() it('does not crash with inccommand #9379', function() local expected_pos = { - [4]={{id=1001}, 'NW', 1, 2, 0, true}, + [4]={1001, 'NW', 1, 2, 0, true}, } command("set inccommand=split") @@ -4542,7 +4542,7 @@ describe('float window', function() describe('and completion', function() before_each(function() local buf = api.nvim_create_buf(false,false) - local win = api.nvim_open_win(buf, true, {relative='editor', width=12, height=4, row=2, col=5}).id + local win = api.nvim_open_win(buf, true, {relative='editor', width=12, height=4, row=2, col=5}) api.nvim_set_option_value('winhl', 'Normal:ErrorMsg', {win=win}) if multigrid then screen:expect{grid=[[ @@ -4558,7 +4558,7 @@ describe('float window', function() {7:^ }| {12:~ }|*3 ]], float_pos={ - [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {1001, "NW", 1, 2, 5, true}, }} else screen:expect([[ @@ -4592,8 +4592,8 @@ describe('float window', function() {1: word }| {1: longtext }| ]], float_pos={ - [4] = {{ id = 1001 }, "NW", 1, 2, 5, true, 50}, - [5] = {{ id = -1 }, "NW", 4, 1, 1, false, 100} + [4] = {1001, "NW", 1, 2, 5, true, 50}, + [5] = {-1, "NW", 4, 1, 1, false, 100} }} else screen:expect([[ @@ -4622,7 +4622,7 @@ describe('float window', function() {7:x a^a }| {12:~ }|*3 ]], float_pos={ - [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {1001, "NW", 1, 2, 5, true}, }} else @@ -4655,8 +4655,8 @@ describe('float window', function() {1:yy }| {1:zz }| ]], float_pos={ - [4] = {{ id = 1001 }, "NW", 1, 2, 5, true, 50}, - [5] = {{ id = -1 }, "NW", 2, 1, 0, false, 100} + [4] = {1001, "NW", 1, 2, 5, true, 50}, + [5] = {-1, "NW", 2, 1, 0, false, 100} }} else screen:expect([[ @@ -4684,7 +4684,7 @@ describe('float window', function() {7:x aa }| {12:~ }|*3 ]], float_pos={ - [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {1001, "NW", 1, 2, 5, true}, }} else screen:expect([[ @@ -4717,8 +4717,8 @@ describe('float window', function() {1: undefine }| {1: unplace }| ]], float_pos={ - [5] = {{id = -1}, "SW", 1, 6, 5, false, 250}; - [4] = {{id = 1001}, "NW", 1, 2, 5, true, 50}; + [5] = {-1, "SW", 1, 6, 5, false, 250}; + [4] = {1001, "NW", 1, 2, 5, true, 50}; }} else screen:expect{grid=[[ @@ -4752,7 +4752,7 @@ describe('float window', function() {7:x aa^ }| {12:~ }|*3 ]], float_pos={ - [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {1001, "NW", 1, 2, 5, true}, }, popupmenu={ anchor = {4, 0, 2}, items = items, pos = 0 }} @@ -4783,7 +4783,7 @@ describe('float window', function() {7:x a^a }| {12:~ }|*3 ]], float_pos={ - [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {1001, "NW", 1, 2, 5, true}, }} else screen:expect([[ @@ -4812,7 +4812,7 @@ describe('float window', function() {7:x aa }| {12:~ }|*3 ]], float_pos={ - [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {1001, "NW", 1, 2, 5, true}, }, popupmenu={ anchor = {2, 0, 0}, items = items, pos = 0 }} @@ -4843,7 +4843,7 @@ describe('float window', function() {7:x aa }| {12:~ }|*3 ]], float_pos={ - [4] = {{ id = 1001 }, "NW", 1, 2, 5, true}, + [4] = {1001, "NW", 1, 2, 5, true}, }} else screen:expect([[ @@ -4878,7 +4878,7 @@ describe('float window', function() {1:word }| {1:longtext }| ]], float_pos={ - [4] = {{id = -1}, "NW", 2, 1, 0, false, 100}} + [4] = {-1, "NW", 2, 1, 0, false, 100}} } else screen:expect([[ @@ -4912,8 +4912,8 @@ describe('float window', function() {15:some info }| {15:about item }| ]], float_pos={ - [4] = {{id = -1}, "NW", 2, 1, 0, false, 100}, - [5] = {{id = 1001}, "NW", 2, 1, 12, true, 50}, + [4] = {-1, "NW", 2, 1, 0, false, 100}, + [5] = {1001, "NW", 2, 1, 12, true, 50}, }} else screen:expect([[ @@ -4943,7 +4943,7 @@ describe('float window', function() {15:some info }| {15:about item }| ]], float_pos={ - [5] = {{id = 1001}, "NW", 2, 1, 12, true}, + [5] = {1001, "NW", 2, 1, 12, true}, }} else screen:expect([[ @@ -4993,7 +4993,7 @@ describe('float window', function() {1:word }| {1:longtext }| ]], float_pos={ - [4] = {{id = -1}, "NW", 2, 1, 0, false, 100}, + [4] = {-1, "NW", 2, 1, 0, false, 100}, }} else screen:expect([[ @@ -5048,10 +5048,10 @@ describe('float window', function() here | float | ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 2, 5, true, 50}; + [4] = {1001, "NW", 1, 2, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -5077,7 +5077,7 @@ describe('float window', function() win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) api.nvim_buf_set_lines(buf,0,-1,true,{"y"}) expected_pos = { - [4]={{id=1001}, 'NW', 1, 2, 5, true} + [4]={1001, 'NW', 1, 2, 5, true} } if multigrid then screen:expect{grid=[[ @@ -6174,8 +6174,8 @@ describe('float window', function() {1:^y }| {2:~ }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 2, 5, true}, - [5] = {{id = 1002}, "NW", 1, 4, 8, true} + [4] = {1001, "NW", 1, 2, 5, true}, + [5] = {1002, "NW", 1, 4, 8, true} }} else screen:expect([[ @@ -6204,7 +6204,7 @@ describe('float window', function() {1:^y }| {2:~ }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 2, 5, true}, + [4] = {1001, "NW", 1, 2, 5, true}, }} else screen:expect([[ @@ -6880,10 +6880,10 @@ describe('float window', function() {1:bar }| {1:baz }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 2, 5, true, 50}; + [4] = {1001, "NW", 1, 2, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} api.nvim_input_mouse('left', 'press', '', 4, 0, 0) @@ -6901,10 +6901,10 @@ describe('float window', function() {1:bar }| {1:baz }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 2, 5, true, 50}; + [4] = {1001, "NW", 1, 2, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} api.nvim_input_mouse('left', 'drag', '', 4, 1, 2) @@ -6922,10 +6922,10 @@ describe('float window', function() {27:ba}{1:^r }| {1:baz }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 2, 5, true, 50}; + [4] = {1001, "NW", 1, 2, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 1, curcol = 2, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 1, curcol = 2, linecount = 3, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -6983,10 +6983,10 @@ describe('float window', function() {5:│}{1:baz }{5:│}| {5:└────────────────────┘}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 0, 5, true, 50}; + [4] = {1001, "NW", 1, 0, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} api.nvim_input_mouse('left', 'press', '', 4, 1, 1) @@ -7006,10 +7006,10 @@ describe('float window', function() {5:│}{1:baz }{5:│}| {5:└────────────────────┘}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 0, 5, true, 50}; + [4] = {1001, "NW", 1, 0, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} api.nvim_input_mouse('left', 'drag', '', 4, 2, 3) @@ -7029,10 +7029,10 @@ describe('float window', function() {5:│}{1:baz }{5:│}| {5:└────────────────────┘}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 0, 5, true, 50}; + [4] = {1001, "NW", 1, 0, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 1, curcol = 2, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 1, curcol = 2, linecount = 3, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -7073,7 +7073,7 @@ describe('float window', function() local buf = api.nvim_create_buf(false,false) api.nvim_buf_set_lines(buf, 0, -1, true, {'foo', 'bar', 'baz'}) local float_win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=4, row=1, col=5}) - api.nvim_set_option_value('winbar', 'floaty bar', {win=float_win.id}) + api.nvim_set_option_value('winbar', 'floaty bar', {win=float_win}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7090,10 +7090,10 @@ describe('float window', function() {1:bar }| {1:baz }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 1, 5, true, 50}; + [4] = {1001, "NW", 1, 1, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} api.nvim_input_mouse('left', 'press', '', 4, 1, 0) @@ -7112,10 +7112,10 @@ describe('float window', function() {1:bar }| {1:baz }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 1, 5, true, 50}; + [4] = {1001, "NW", 1, 1, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} api.nvim_input_mouse('left', 'drag', '', 4, 2, 2) @@ -7134,10 +7134,10 @@ describe('float window', function() {27:ba}{1:^r }| {1:baz }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 1, 5, true, 50}; + [4] = {1001, "NW", 1, 1, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 1, curcol = 2, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 1, curcol = 2, linecount = 3, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -7283,10 +7283,10 @@ describe('float window', function() {5:│}{1: }{5:│}|*3 {5:└────────────────────┘}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 0, 5, true, 50}; + [4] = {1001, "NW", 1, 0, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -7338,10 +7338,10 @@ describe('float window', function() {5:│}{2:~ }{5:│}| {5:└────────────────────┘}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 0, 5, true, 50}; + [4] = {1001, "NW", 1, 0, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 4, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 4, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -7373,10 +7373,10 @@ describe('float window', function() {5:│}{19:│}{1: }{5:│}| {5:└────────────────────┘}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 0, 5, true, 50}; + [4] = {1001, "NW", 1, 0, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 3, sum_scroll_delta = 0}; }} else api.nvim_input_mouse('left', 'press', '', 0, 2, 6) @@ -7477,7 +7477,7 @@ describe('float window', function() {1:test }| {1: }| {1:popup text }| - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 2, 5, true}}} else screen:expect([[ Ut enim ad minim veniam, quis nostrud | @@ -7492,7 +7492,7 @@ describe('float window', function() ]]) end - api.nvim_set_option_value("winblend", 30, {win=win.id}) + api.nvim_set_option_value("winblend", 30, {win=win}) if multigrid then screen:expect{grid=[[ ## grid 1 @@ -7513,7 +7513,7 @@ describe('float window', function() {9:test }| {9: }| {9:popup text }| - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}, unchanged=true} + ]], float_pos={[4] = {1001, "NW", 1, 2, 5, true}}, unchanged=true} else screen:expect([[ Ut enim ad minim veniam, quis nostrud | @@ -7550,7 +7550,7 @@ describe('float window', function() {13:test }| {13: }| {13:popup text }| - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 2, 5, true}}} else screen:expect([[ Ut enim ad minim veniam, quis nostrud | @@ -7595,7 +7595,7 @@ describe('float window', function() {9:test }| {9: }| {10:popup text}{9: }| - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 2, 5, true}}} else screen:expect([[ Ut enim ad minim veniam, quis nostrud | @@ -7631,7 +7631,7 @@ describe('float window', function() {9:test }| {9: }| {11:popup text}{9: }| - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}, unchanged=true} + ]], float_pos={[4] = {1001, "NW", 1, 2, 5, true}}, unchanged=true} else screen:expect([[ Ut enim ad minim veniam, quis nostrud | @@ -7667,7 +7667,7 @@ describe('float window', function() ## grid 4 {11:popup text}{9: }| {12:~ }|*2 - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 2, 5, true}}} else api.nvim_input_mouse('wheel', 'down', '', 0, 4, 7) screen:expect([[ @@ -7685,7 +7685,7 @@ describe('float window', function() -- Check that 'winblend' applies to border/title/footer api.nvim_win_set_config(win, {border='single', title='Title', footer='Footer'}) - api.nvim_set_option_value('winblend', 100, {win=win.id}) + api.nvim_set_option_value('winblend', 100, {win=win}) api.nvim_set_option_value("cursorline", true, {win=0}) command('hi clear VertSplit') feed('k0') @@ -7710,7 +7710,7 @@ describe('float window', function() {17:│}{11:popup text}{18: }{17:│}| {17:│}{19:~ }{17:│}|*2 {17:└}{23:Footer}{17:─────────┘}| - ]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}} + ]], float_pos={[4] = {1001, "NW", 1, 2, 5, true}}} else screen:expect([[ Ut enim ad minim veniam, quis nostrud | @@ -7747,7 +7747,7 @@ describe('float window', function() ## grid 4 {1:口 }|*2 {1: }| - ]], float_pos={ [4] = { { id = 1001 }, "NW", 1, 0, 11, true } }} + ]], float_pos={ [4] = { 1001, "NW", 1, 0, 11, true } }} else screen:expect([[ # TODO: 测 {1:口 }信息的准确性 | @@ -7785,7 +7785,7 @@ describe('float window', function() -- at least. Also check invisible EndOfBuffer region blends correctly. api.nvim_buf_set_lines(buf, 0, -1, true, {" x x x xx", " x x x x"}) win = api.nvim_open_win(buf, false, {relative='editor', width=12, height=3, row=0, col=11, style='minimal'}) - api.nvim_set_option_value('winblend', 30, {win=win.id}) + api.nvim_set_option_value('winblend', 30, {win=win}) screen:set_default_attr_ids({ [1] = {foreground = tonumber('0xb282b2'), background = tonumber('0xffcfff')}, [2] = {foreground = Screen.colors.Grey0, background = tonumber('0xffcfff')}, @@ -7809,7 +7809,7 @@ describe('float window', function() {5: x x x x}| {5: }| ]], float_pos={ - [5] = { { id = 1002 }, "NW", 1, 0, 11, true } + [5] = { 1002, "NW", 1, 0, 11, true } }} else screen:expect([[ @@ -7838,7 +7838,7 @@ describe('float window', function() {5: x x x x}| {5: }| ]], float_pos={ - [5] = { { id = 1002 }, "NW", 1, 0, 12, true } + [5] = { 1002, "NW", 1, 0, 12, true } }} else screen:expect([[ @@ -7901,12 +7901,8 @@ describe('float window', function() [1] = {foreground = Screen.colors.Blue1, bold = true}; [2] = {background = Screen.colors.LightMagenta}; }, float_pos={ - [4] = { { - id = 1001 - }, "NW", 1, 1, 1, true }, - [5] = { { - id = 1002 - }, "NW", 1, 0, 0, true } + [4] = { 1001, "NW", 1, 1, 1, true }, + [5] = { 1002, "NW", 1, 0, 0, true } }} else screen:expect([[ @@ -7958,8 +7954,8 @@ describe('float window', function() [1] = {foreground = Screen.colors.Blue1, bold = true}; [2] = {background = Screen.colors.LightMagenta}; }, float_pos={ - [4] = { { id = 1001 }, "NW", 1, 1, 1, true }, - [5] = { { id = 1002 }, "NW", 1, 0, 0, true } + [4] = { 1001, "NW", 1, 1, 1, true }, + [5] = { 1002, "NW", 1, 0, 0, true } }} else screen:expect([[ @@ -7977,7 +7973,7 @@ describe('float window', function() it("correctly orders multiple opened floats (current last)", function() local buf = api.nvim_create_buf(false,false) local win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) - api.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win.id}) + api.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win}) if multigrid then screen:expect{grid=[[ @@ -7993,10 +7989,10 @@ describe('float window', function() {7: }| {7:~ }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true }; + [4] = { 1001, "NW", 1, 2, 5, true }; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8038,14 +8034,14 @@ describe('float window', function() {17:^ }| {17:~ }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true }; - [5] = { { id = 1002 }, "NW", 1, 3, 8, true }; - [6] = { { id = 1003 }, "NW", 1, 4, 10, true }; + [4] = { 1001, "NW", 1, 2, 5, true }; + [5] = { 1002, "NW", 1, 3, 8, true }; + [6] = { 1003, "NW", 1, 4, 10, true }; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount=1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount=1, sum_scroll_delta = 0}; - [5] = {win = {id = 1002}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount=1, sum_scroll_delta = 0}; - [6] = {win = {id = 1003}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount=1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount=1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount=1, sum_scroll_delta = 0}; + [5] = {win = 1002, topline = 0, botline = 2, curline = 0, curcol = 0, linecount=1, sum_scroll_delta = 0}; + [6] = {win = 1003, topline = 0, botline = 2, curline = 0, curcol = 0, linecount=1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8063,7 +8059,7 @@ describe('float window', function() it("correctly orders multiple opened floats (non-current last)", function() local buf = api.nvim_create_buf(false,false) local win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=2, col=5}) - api.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win.id}) + api.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win}) if multigrid then screen:expect{grid=[[ @@ -8079,10 +8075,10 @@ describe('float window', function() {7: }| {7:~ }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true }; + [4] = { 1001, "NW", 1, 2, 5, true }; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8124,14 +8120,14 @@ describe('float window', function() {1: }| {1:~ }| ]], float_pos={ - [4] = { { id = 1001 }, "NW", 1, 2, 5, true }; - [5] = { { id = 1002 }, "NW", 1, 4, 10, true }; - [6] = { { id = 1003 }, "NW", 1, 3, 8, true }; + [4] = { 1001, "NW", 1, 2, 5, true }; + [5] = { 1002, "NW", 1, 4, 10, true }; + [6] = { 1003, "NW", 1, 3, 8, true }; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [5] = {win = {id = 1002}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [6] = {win = {id = 1003}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [5] = {win = 1002, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [6] = {win = 1003, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8149,11 +8145,11 @@ describe('float window', function() it('can use z-index', function() local buf = api.nvim_create_buf(false,false) local win1 = api.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=1, col=5, zindex=30}) - api.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win1.id}) + api.nvim_set_option_value("winhl", "Normal:ErrorMsg,EndOfBuffer:ErrorMsg", {win=win1}) local win2 = api.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=2, col=6, zindex=50}) - api.nvim_set_option_value("winhl", "Normal:Search,EndOfBuffer:Search", {win=win2.id}) + api.nvim_set_option_value("winhl", "Normal:Search,EndOfBuffer:Search", {win=win2}) local win3 = api.nvim_open_win(buf, false, {relative='editor', width=20, height=3, row=3, col=7, zindex=40}) - api.nvim_set_option_value("winhl", "Normal:Question,EndOfBuffer:Question", {win=win3.id}) + api.nvim_set_option_value("winhl", "Normal:Question,EndOfBuffer:Question", {win=win3}) if multigrid then screen:expect{grid=[[ @@ -8175,14 +8171,14 @@ describe('float window', function() {8: }| {8:~ }|*2 ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 1, 5, true, 30}; - [5] = {{id = 1002}, "NW", 1, 2, 6, true, 50}; - [6] = {{id = 1003}, "NW", 1, 3, 7, true, 40}; + [4] = {1001, "NW", 1, 1, 5, true, 30}; + [5] = {1002, "NW", 1, 2, 6, true, 50}; + [6] = {1003, "NW", 1, 3, 7, true, 40}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [5] = {win = {id = 1002}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [6] = {win = {id = 1003}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [5] = {win = 1002, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [6] = {win = 1003, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8200,7 +8196,7 @@ describe('float window', function() it('can use winbar', function() local buf = api.nvim_create_buf(false,false) local win1 = api.nvim_open_win(buf, false, {relative='editor', width=15, height=3, row=1, col=5}) - api.nvim_set_option_value('winbar', 'floaty bar', {win=win1.id}) + api.nvim_set_option_value('winbar', 'floaty bar', {win=win1}) if multigrid then screen:expect{grid=[[ @@ -8217,10 +8213,10 @@ describe('float window', function() {1: }| {2:~ }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 1, 5, true, 50}; + [4] = {1001, "NW", 1, 1, 5, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8253,10 +8249,10 @@ describe('float window', function() {5:│}{2:~ }{5:│}|*2 {5:└───────────────┘}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 0, 4, true, 50}; + [4] = {1001, "NW", 1, 0, 4, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8289,10 +8285,10 @@ describe('float window', function() {5:│}{1: }{5:│}|*4 {5:└────────────────────────────────────────┘}| ]], float_pos={ - [4] = {{id = 1001}, "SW", 1, 9, 0, true, 50}; + [4] = {1001, "SW", 1, 9, 0, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8323,10 +8319,10 @@ describe('float window', function() {5:│}{1: }{5:│}|*2 {5:└────────────────────────────────────────┘}| ]], float_pos={ - [4] = {{id = 1001}, "SW", 1, 9, 0, true, 50}; + [4] = {1001, "SW", 1, 9, 0, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8349,7 +8345,7 @@ describe('float window', function() {0:~ }|*8 ## grid 3 ]], win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8379,10 +8375,10 @@ describe('float window', function() {5:│}{1: }{5:│}|*4 {5:└────────────────────────────────────────┘}| ]], float_pos={ - [4] = {{id = 1001}, "SW", 1, 8, 0, true, 50}; + [4] = {1001, "SW", 1, 8, 0, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8420,10 +8416,10 @@ describe('float window', function() {5:│}{1: }{5:│}|*4 {5:└────────────────────────────────────────┘}| ]], float_pos={ - [4] = {{id = 1001}, "SW", 1, 8, 0, true, 50}; + [4] = {1001, "SW", 1, 8, 0, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8453,10 +8449,10 @@ describe('float window', function() {5:│}{1: }{5:│}|*2 {5:└────────────────────────────────────────┘}| ]], float_pos={ - [4] = {{id = 1001}, "SW", 1, 8, 0, true, 50}; + [4] = {1001, "SW", 1, 8, 0, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8481,7 +8477,7 @@ describe('float window', function() ## grid 3 | ]], win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8497,7 +8493,7 @@ describe('float window', function() local float_opts = {relative = 'editor', row = 1, col = 1, width = 10, height = 10} api.nvim_open_win(api.nvim_create_buf(false, false), true, float_opts) if multigrid then - screen:expect({float_pos = {[4] = {{id = 1001}, 'NW', 1, 1, 1, true}}}) + screen:expect({float_pos = {[4] = {1001, 'NW', 1, 1, 1, true}}}) end command(cmd) exec_lua([[ @@ -8540,10 +8536,10 @@ describe('float window', function() {1:cd }| {2:~ }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 1, 1, true, 50}; + [4] = {1001, "NW", 1, 1, 1, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 1, curcol = 1, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 1, curcol = 1, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8572,10 +8568,10 @@ describe('float window', function() {1:c^d }| {2:~ }| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 1, 1, true, 50}; + [4] = {1001, "NW", 1, 1, 1, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 1, curcol = 1, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 1, curcol = 1, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8609,10 +8605,10 @@ describe('float window', function() {5:│}{2:~ }{5:│}| {5:└────┘}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 1, 1, true, 50}; + [4] = {1001, "NW", 1, 1, 1, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 1, curcol = 1, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 1, curcol = 1, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8644,10 +8640,10 @@ describe('float window', function() {5:│}{2:~ }{5:│}| {5:└────┘}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 1, 1, true, 50}; + [4] = {1001, "NW", 1, 1, 1, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 1, curcol = 1, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 1, curcol = 1, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8682,10 +8678,10 @@ describe('float window', function() {5:│}{1:cd }{5:│}| {5:└────┘}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 1, 1, true, 50}; + [4] = {1001, "NW", 1, 1, 1, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 1, curcol = 1, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 1, curcol = 1, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8717,10 +8713,10 @@ describe('float window', function() {5:│}{1:c^d }{5:│}| {5:└────┘}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 1, 1, true, 50}; + [4] = {1001, "NW", 1, 1, 1, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 1, curcol = 1, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 1, curcol = 1, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8759,10 +8755,10 @@ describe('float window', function() {5:│}{2: ~}{5:│}| {5:└─────┘}| ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 1, 1, true, 50}; + [4] = {1001, "NW", 1, 1, 1, true, 50}; }, win_viewport={ - [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; - [4] = {win = {id = 1001}, topline = 0, botline = 3, curline = 1, curcol = 2, linecount = 2, sum_scroll_delta = 0}; + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 3, curline = 1, curcol = 2, linecount = 2, sum_scroll_delta = 0}; }} else screen:expect{grid=[[ @@ -8781,7 +8777,7 @@ describe('float window', function() local buf = api.nvim_create_buf(false,false) local win = api.nvim_open_win(buf, false, {relative='editor', width=10, height=2, row=2, col=5, hide = true}) local expected_pos = { - [4]={{id=1001}, 'NW', 1, 2, 5, true}, + [4]={1001, 'NW', 1, 2, 5, true}, } if multigrid then @@ -8873,10 +8869,10 @@ describe('float window', function() api.nvim_open_win(buf_c, false, config_c) api.nvim_open_win(buf_d, false, config_d) local expected_pos = { - [4]={{id=1001}, 'NW', 1, 5, 5, true, 50}, - [5]={{id=1002}, 'NW', 1, 7, 7, true, 70}, - [6]={{id=1003}, 'NW', 1, 9, 9, true, 90}, - [7]={{id=1004}, 'NW', 1, 10, 10, true, 100}, + [4]={1001, 'NW', 1, 5, 5, true, 50}, + [5]={1002, 'NW', 1, 7, 7, true, 70}, + [6]={1003, 'NW', 1, 9, 9, true, 90}, + [7]={1004, 'NW', 1, 10, 10, true, 100}, } if multigrid then screen:expect{grid=[[ -- cgit From 6bba4becedaea5a330c0c9d9427fb495e8092dac Mon Sep 17 00:00:00 2001 From: Will Hopkins Date: Wed, 31 Jan 2024 19:43:35 -0800 Subject: feat(api): make nvim_open_win support non-floating windows (#25550) Adds support to `nvim_open_win` and `nvim_win_set_config` for creating and manipulating split (non-floating) windows. --- test/functional/ui/float_spec.lua | 57 +++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 23 deletions(-) (limited to 'test/functional/ui/float_spec.lua') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index b05e7aceda..397c1f6132 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -104,14 +104,20 @@ describe('float window', function() end) it('open with WinNew autocmd', function() - local res = exec_lua([[ - local triggerd = false + local new_triggered_before_enter, new_curwin, win = unpack(exec_lua([[ + local enter_triggered = false + local new_triggered_before_enter = false + local new_curwin local buf = vim.api.nvim_create_buf(true, true) + vim.api.nvim_create_autocmd('WinEnter', { + callback = function() + enter_triggered = true + end + }) vim.api.nvim_create_autocmd('WinNew', { - callback = function(opt) - if opt.buf == buf then - triggerd = true - end + callback = function() + new_triggered_before_enter = not enter_triggered + new_curwin = vim.api.nvim_get_current_win() end }) local opts = { @@ -120,10 +126,11 @@ describe('float window', function() width = 1, height = 1, noautocmd = false, } - vim.api.nvim_open_win(buf, true, opts) - return triggerd - ]]) - eq(true, res) + local win = vim.api.nvim_open_win(buf, true, opts) + return {new_triggered_before_enter, new_curwin, win} + ]])) + eq(true, new_triggered_before_enter) + eq(win, new_curwin) end) it('opened with correct height', function() @@ -1095,7 +1102,7 @@ describe('float window', function() local expected = {anchor='NW', col=5, external=false, focusable=true, height=2, relative='editor', row=3, width=20, zindex=60, hide=false} eq(expected, api.nvim_win_get_config(win)) - eq({relative='', external=false, focusable=true, hide=false}, api.nvim_win_get_config(0)) + eq({external=false, focusable=true, hide=false, relative='',split="left",width=40,height=6}, api.nvim_win_get_config(0)) if multigrid then api.nvim_win_set_config(win, {external=true, width=10, height=1}) @@ -2878,27 +2885,31 @@ describe('float window', function() it('API has proper error messages', function() local buf = api.nvim_create_buf(false,false) eq("Invalid key: 'bork'", - pcall_err(api.nvim_open_win,buf, false, {width=20,height=2,bork=true})) - eq("'win' key is only valid with relative='win'", - pcall_err(api.nvim_open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,win=0})) + pcall_err(api.nvim_open_win, buf, false, {width=20,height=2,bork=true})) + eq("'win' key is only valid with relative='win' and relative=''", + pcall_err(api.nvim_open_win, buf, false, {width=20,height=2,relative='editor',row=0,col=0,win=0})) + eq("floating windows cannot have 'vertical'", + pcall_err(api.nvim_open_win, buf, false, {width=20,height=2,relative='editor',row=0,col=0,vertical=true})) + eq("floating windows cannot have 'split'", + pcall_err(api.nvim_open_win, buf, false, {width=20,height=2,relative='editor',row=0,col=0,split="left"})) eq("Only one of 'relative' and 'external' must be used", - pcall_err(api.nvim_open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,external=true})) + pcall_err(api.nvim_open_win, buf, false, {width=20,height=2,relative='editor',row=0,col=0,external=true})) eq("Invalid value of 'relative' key", - pcall_err(api.nvim_open_win,buf, false, {width=20,height=2,relative='shell',row=0,col=0})) + pcall_err(api.nvim_open_win, buf, false, {width=20,height=2,relative='shell',row=0,col=0})) eq("Invalid value of 'anchor' key", - pcall_err(api.nvim_open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,anchor='bottom'})) + pcall_err(api.nvim_open_win, buf, false, {width=20,height=2,relative='editor',row=0,col=0,anchor='bottom'})) eq("'relative' requires 'row'/'col' or 'bufpos'", - pcall_err(api.nvim_open_win,buf, false, {width=20,height=2,relative='editor'})) + pcall_err(api.nvim_open_win, buf, false, {width=20,height=2,relative='editor'})) eq("'width' key must be a positive Integer", - pcall_err(api.nvim_open_win,buf, false, {width=-1,height=2,relative='editor', row=0, col=0})) + pcall_err(api.nvim_open_win, buf, false, {width=-1,height=2,relative='editor', row=0, col=0})) eq("'height' key must be a positive Integer", - pcall_err(api.nvim_open_win,buf, false, {width=20,height=-1,relative='editor', row=0, col=0})) + pcall_err(api.nvim_open_win, buf, false, {width=20,height=-1,relative='editor', row=0, col=0})) eq("'height' key must be a positive Integer", - pcall_err(api.nvim_open_win,buf, false, {width=20,height=0,relative='editor', row=0, col=0})) + pcall_err(api.nvim_open_win, buf, false, {width=20,height=0,relative='editor', row=0, col=0})) eq("Must specify 'width'", - pcall_err(api.nvim_open_win,buf, false, {relative='editor', row=0, col=0})) + pcall_err(api.nvim_open_win, buf, false, {relative='editor', row=0, col=0})) eq("Must specify 'height'", - pcall_err(api.nvim_open_win,buf, false, {relative='editor', row=0, col=0, width=2})) + pcall_err(api.nvim_open_win, buf, false, {relative='editor', row=0, col=0, width=2})) end) it('can be placed relative window or cursor', function() -- cgit From f9d81c43d2296d212c9cebcbdce401cd76cf0f1f Mon Sep 17 00:00:00 2001 From: bfredl Date: Wed, 31 Jan 2024 22:02:06 +0100 Subject: refactor(api): use keydict and arena for more api return values Implement api_keydict_to_dict as the complement to api_dict_to_keydict Fix a conversion error when nvim_get_win_config gets called from lua, where Float values "x" and "y" didn't get converted to lua numbers. --- test/functional/ui/float_spec.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/functional/ui/float_spec.lua') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 397c1f6132..60ba9f3958 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -1101,6 +1101,15 @@ describe('float window', function() local win = api.nvim_open_win(buf, false, {relative='editor', width=20, height=2, row=3, col=5, zindex=60}) local expected = {anchor='NW', col=5, external=false, focusable=true, height=2, relative='editor', row=3, width=20, zindex=60, hide=false} eq(expected, api.nvim_win_get_config(win)) + eq(true, exec_lua([[ + local expected, win = ... + local actual = vim.api.nvim_win_get_config(win) + for k,v in pairs(expected) do + if v ~= actual[k] then + error(k) + end + end + return true]], expected, win)) eq({external=false, focusable=true, hide=false, relative='',split="left",width=40,height=6}, api.nvim_win_get_config(0)) -- cgit From 31b3c62845fe7da41eed0089990e1540b9a41053 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 15 Feb 2024 07:49:39 +0800 Subject: vim-patch:9.1.0106: Visual highlight hard to read with 'termguicolors' Problem: Visual highlight hard to read with 'termguicolors' (Maxim Kim) Solution: Set Visual GUI foreground to black (with background=light) and lightgrey (with background=dark) (Maxim Kim) fixes: vim/vim#14024 closes: vim/vim#14025 https://github.com/vim/vim/commit/34e4a05d02a016fe230495be8f6c60ddd56f9567 Co-authored-by: Maxim Kim --- test/functional/ui/float_spec.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/functional/ui/float_spec.lua') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 60ba9f3958..4d06a24d3f 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -869,8 +869,8 @@ describe('float window', function() [24] = {foreground = Screen.colors.Black, background = Screen.colors.Grey80}; [25] = {blend = 100, background = Screen.colors.Gray0}; [26] = {blend = 80, background = Screen.colors.Gray0}; - [27] = {background = Screen.colors.LightGray}; - [28] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGray}; + [27] = {foreground = Screen.colors.Black, background = Screen.colors.LightGrey}; + [28] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey}; } screen:set_default_attr_ids(attrs) end) @@ -7448,8 +7448,8 @@ describe('float window', function() [10] = {foreground = Screen.colors.Red, background = Screen.colors.LightMagenta, blend = 0}, [11] = {foreground = Screen.colors.Red, background = Screen.colors.LightMagenta, blend = 80}, [12] = {background = Screen.colors.LightMagenta, bold = true, foreground = Screen.colors.Blue1, blend = 30}, - [13] = {background = Screen.colors.LightGray, blend = 30}, - [14] = {foreground = Screen.colors.Grey0, background = Screen.colors.Grey88}, + [13] = {foreground = Screen.colors.Black, background = Screen.colors.LightGray, blend = 30}, + [14] = {foreground = Screen.colors.Black, background = Screen.colors.Grey88}, [15] = {foreground = tonumber('0x939393'), background = Screen.colors.Grey88}, [16] = {background = Screen.colors.Grey90}; [17] = {blend = 100}; -- cgit From 884470124db3848283dc3ae7c43b4b119d4162f9 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Fri, 1 Mar 2024 14:51:49 +0100 Subject: fix(float): allow floating window in cmdline area Problem: Floats are arbitrarily positioned at 1 row above screen size. Solution: Position at 1 row above 'cmdheight', only if window is hidden behind the message area. --- test/functional/ui/float_spec.lua | 71 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'test/functional/ui/float_spec.lua') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 4d06a24d3f..cdb3b79963 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -9030,6 +9030,77 @@ describe('float window', function() ]]) end end) + + it('correctly placed in or above message area', function() + local float_opts = {relative='editor', width=5, height=1, row=100, col=1, border = 'single'} + api.nvim_set_option_value('cmdheight', 3, {}) + command("echo 'cmdline'") + local win = api.nvim_open_win(api.nvim_create_buf(false, false), true, float_opts) + -- Not hidden behind message area but placed above it. + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:----------------------------------------]|*4 + [3:----------------------------------------]|*3 + ## grid 2 + | + {0:~ }|*3 + ## grid 3 + cmdline | + |*2 + ## grid 4 + {5:┌─────┐}| + {5:│}{1:^ }{5:│}| + {5:└─────┘}| + ]], float_pos={ + [4] = {1001, "NW", 1, 100, 1, true, 50}; + }, win_viewport={ + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + }} + else + screen:expect{grid=[[ + | + {0:~}{5:┌─────┐}{0: }| + {0:~}{5:│}{1:^ }{5:│}{0: }| + {0:~}{5:└─────┘}{0: }| + cmdline | + |*2 + ]]} + end + -- Not placed above message area and visible on top of it. + api.nvim_win_set_config(win, {zindex = 300}) + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:----------------------------------------]|*4 + [3:----------------------------------------]|*3 + ## grid 2 + | + {0:~ }|*3 + ## grid 3 + cmdline | + |*2 + ## grid 4 + {5:┌─────┐}| + {5:│}{1:^ }{5:│}| + {5:└─────┘}| + ]], float_pos={ + [4] = {1001, "NW", 1, 100, 1, true, 300}; + }, win_viewport={ + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 1, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + }} + else + screen:expect{grid=[[ + | + {0:~ }|*3 + c{5:┌─────┐} | + {5:│}{1:^ }{5:│} | + {5:└─────┘} | + ]]} + end + end) end describe('with ext_multigrid', function() -- cgit