diff options
| author | bfredl <bjorn.linse@gmail.com> | 2024-11-09 14:14:29 +0100 |
|---|---|---|
| committer | bfredl <bjorn.linse@gmail.com> | 2024-11-11 14:27:25 +0100 |
| commit | 29fd5ed606bccab28faaa55fd772704f7ca7d315 (patch) | |
| tree | e70d2830c10edf20caf1200ed7f2bf742d7a10de /test/functional/ui/mouse_spec.lua | |
| parent | d0e78b587195d201d643f3e131dd1ea951d906db (diff) | |
| download | rneovim-29fd5ed606bccab28faaa55fd772704f7ca7d315.tar.gz rneovim-29fd5ed606bccab28faaa55fd772704f7ca7d315.tar.bz2 rneovim-29fd5ed606bccab28faaa55fd772704f7ca7d315.zip | |
refactor(tests): use more global highlight definitions
Diffstat (limited to 'test/functional/ui/mouse_spec.lua')
| -rw-r--r-- | test/functional/ui/mouse_spec.lua | 943 |
1 files changed, 452 insertions, 491 deletions
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 471ee70906..3f071ffd6a 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -22,29 +22,20 @@ describe('ui/mouse/input', function() command('setl listchars=nbsp:x') screen = Screen.new(25, 5) screen:attach() - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, - [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, - [2] = { bold = true }, - [3] = { - foreground = Screen.colors.Blue, - background = Screen.colors.LightGrey, + screen:add_extra_attr_ids { + [100] = { bold = true, + background = Screen.colors.LightGrey, + foreground = Screen.colors.Blue1, }, - [4] = { reverse = true }, - [5] = { bold = true, reverse = true }, - [6] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red }, - [7] = { bold = true, foreground = Screen.colors.SeaGreen4 }, - [8] = { foreground = Screen.colors.Brown }, - [9] = { background = Screen.colors.DarkGrey, foreground = Screen.colors.LightGrey }, - }) + } command('set mousemodel=extend') feed('itesting<cr>mouse<cr>support and selection<esc>') screen:expect([[ testing | mouse | support and selectio^n | - {0:~ }| + {1:~ }| | ]]) end) @@ -56,7 +47,7 @@ describe('ui/mouse/input', function() testing | mo^use | support and selection | - {0:~ }| + {1:~ }| | ]], mouse_enabled = true, @@ -66,7 +57,7 @@ describe('ui/mouse/input', function() ^testing | mouse | support and selection | - {0:~ }| + {1:~ }| | ]]) end) @@ -79,7 +70,7 @@ describe('ui/mouse/input', function() testing | mo^use | support and selection | - {0:~ }| + {1:~ }| | ]], mouse_enabled = false, @@ -89,7 +80,7 @@ describe('ui/mouse/input', function() ^testing | mouse | support and selection | - {0:~ }| + {1:~ }| | ]]) end) @@ -100,11 +91,11 @@ describe('ui/mouse/input', function() feed('<LeftMouse><0,0>') feed('<LeftRelease><0,0>') screen:expect([[ - {1:testin}^g | + {17:testin}^g | mouse | support and selection | - {0:~ }| - {2:-- VISUAL --} | + {1:~ }| + {5:-- VISUAL --} | ]]) end) @@ -116,11 +107,11 @@ describe('ui/mouse/input', function() feed('<LeftMouse><0,0>') feed('<LeftRelease><0,0>') screen:expect([[ - ^t{1:esting} | + ^t{17:esting} | mouse | support and selection | - {0:~ }| - {2:-- VISUAL LINE --} | + {1:~ }| + {5:-- VISUAL LINE --} | ]]) end) @@ -137,44 +128,35 @@ describe('ui/mouse/input', function() ^testing | mouse | support and selection | - {0:~ }| - {2:-- VISUAL BLOCK --} | + {1:~ }| + {5:-- VISUAL BLOCK --} | ]]) end) describe('tab drag', function() - before_each(function() - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, - tab = { background = Screen.colors.LightGrey, underline = true }, - sel = { bold = true }, - fill = { reverse = true }, - }) - end) - it('in tabline on filler space moves tab to the end', function() feed_command('%delete') insert('this is foo') feed_command('silent file foo | tabnew | file bar') insert('this is bar') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) feed('<LeftMouse><4,0>') screen:expect([[ - {sel: + foo }{tab: + bar }{fill: }{tab:X}| + {5: + foo }{24: + bar }{2: }{24:X}| this is fo^o | - {0:~ }|*2 + {1:~ }|*2 | ]]) feed('<LeftDrag><14,0>') screen:expect([[ - {tab: + bar }{sel: + foo }{fill: }{tab:X}| + {24: + bar }{5: + foo }{2: }{24:X}| this is fo^o | - {0:~ }|*2 + {1:~ }|*2 | ]]) end) @@ -185,9 +167,9 @@ describe('ui/mouse/input', function() feed_command('silent file foo | tabnew | file bar') insert('this is bar') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) feed('<LeftMouse><11,0>') @@ -196,18 +178,18 @@ describe('ui/mouse/input', function() poke_eventloop() screen:expect { grid = [[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]], unchanged = true, } feed('<LeftDrag><6,0>') screen:expect([[ - {sel: + bar }{tab: + foo }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {5: + bar }{24: + foo }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) end) @@ -218,23 +200,23 @@ describe('ui/mouse/input', function() feed_command('silent file foo | tabnew | file bar') insert('this is bar') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) feed('<LeftMouse><4,0>') screen:expect([[ - {sel: + foo }{tab: + bar }{fill: }{tab:X}| + {5: + foo }{24: + bar }{2: }{24:X}| this is fo^o | - {0:~ }|*2 + {1:~ }|*2 | ]]) feed('<LeftDrag><7,0>') screen:expect([[ - {tab: + bar }{sel: + foo }{fill: }{tab:X}| + {24: + bar }{5: + foo }{2: }{24:X}| this is fo^o | - {0:~ }|*2 + {1:~ }|*2 | ]]) end) @@ -245,33 +227,33 @@ describe('ui/mouse/input', function() feed_command('silent file foo | tabnew | file bar') insert('this is bar') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) feed('<LeftMouse><4,0>') screen:expect([[ - {sel: + foo }{tab: + bar }{fill: }{tab:X}| + {5: + foo }{24: + bar }{2: }{24:X}| this is fo^o | - {0:~ }|*2 + {1:~ }|*2 | ]]) feed('<LeftDrag><4,1>') screen:expect { grid = [[ - {sel: + foo }{tab: + bar }{fill: }{tab:X}| + {5: + foo }{24: + bar }{2: }{24:X}| this is fo^o | - {0:~ }|*2 + {1:~ }|*2 | ]], unchanged = true, } feed('<LeftDrag><14,1>') screen:expect([[ - {tab: + bar }{sel: + foo }{fill: }{tab:X}| + {24: + bar }{5: + foo }{2: }{24:X}| this is fo^o | - {0:~ }|*2 + {1:~ }|*2 | ]]) end) @@ -282,9 +264,9 @@ describe('ui/mouse/input', function() feed_command('silent file foo | tabnew | file bar') insert('this is bar') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) feed('<LeftMouse><11,0>') @@ -293,9 +275,9 @@ describe('ui/mouse/input', function() poke_eventloop() screen:expect { grid = [[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]], unchanged = true, @@ -303,18 +285,18 @@ describe('ui/mouse/input', function() feed('<LeftDrag><11,1>') screen:expect { grid = [[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]], unchanged = true, } feed('<LeftDrag><6,1>') screen:expect([[ - {sel: + bar }{tab: + foo }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {5: + bar }{24: + foo }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) end) @@ -325,73 +307,64 @@ describe('ui/mouse/input', function() feed_command('silent file foo | tabnew | file bar') insert('this is bar') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) feed('<LeftMouse><4,0>') screen:expect([[ - {sel: + foo }{tab: + bar }{fill: }{tab:X}| + {5: + foo }{24: + bar }{2: }{24:X}| this is fo^o | - {0:~ }|*2 + {1:~ }|*2 | ]]) feed('<LeftDrag><4,1>') screen:expect { grid = [[ - {sel: + foo }{tab: + bar }{fill: }{tab:X}| + {5: + foo }{24: + bar }{2: }{24:X}| this is fo^o | - {0:~ }|*2 + {1:~ }|*2 | ]], unchanged = true, } feed('<LeftDrag><7,1>') screen:expect([[ - {tab: + bar }{sel: + foo }{fill: }{tab:X}| + {24: + bar }{5: + foo }{2: }{24:X}| this is fo^o | - {0:~ }|*2 + {1:~ }|*2 | ]]) end) end) describe('tabline', function() - before_each(function() - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, - tab = { background = Screen.colors.LightGrey, underline = true }, - sel = { bold = true }, - fill = { reverse = true }, - }) - end) - it('left click in default tabline (tabpage label) switches to tab', function() feed_command('%delete') insert('this is foo') feed_command('silent file foo | tabnew | file bar') insert('this is bar') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) feed('<LeftMouse><4,0>') screen:expect([[ - {sel: + foo }{tab: + bar }{fill: }{tab:X}| + {5: + foo }{24: + bar }{2: }{24:X}| this is fo^o | - {0:~ }|*2 + {1:~ }|*2 | ]]) feed('<LeftMouse><6,0>') screen:expect_unchanged() feed('<LeftMouse><10,0>') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) feed('<LeftMouse><12,0>') @@ -404,23 +377,23 @@ describe('ui/mouse/input', function() feed_command('silent file foo | tabnew | file bar') insert('this is bar') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) feed('<LeftMouse><20,0>') screen:expect([[ - {sel: + foo }{tab: + bar }{fill: }{tab:X}| + {5: + foo }{24: + bar }{2: }{24:X}| this is fo^o | - {0:~ }|*2 + {1:~ }|*2 | ]]) feed('<LeftMouse><22,0>') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) end) @@ -432,15 +405,15 @@ describe('ui/mouse/input', function() feed_command('silent file foo | tabnew | file bar') insert('this is bar') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) feed('<LeftMouse><24,0>') screen:expect([[ this is fo^o | - {0:~ }|*3 + {1:~ }|*3 | ]]) end) @@ -451,44 +424,44 @@ describe('ui/mouse/input', function() feed_command('silent file foo | tabnew | file bar') insert('this is bar') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) feed('<2-LeftMouse><4,0>') screen:expect([[ - {sel: Name] }{tab: + foo + bar }{fill: }{tab:X}| - {0:^$} | - {0:~ }|*2 + {5: Name] }{24: + foo + bar }{2: }{24:X}| + {1:^$} | + {1:~ }|*2 | ]]) command('tabclose') screen:expect([[ - {sel: + foo }{tab: + bar }{fill: }{tab:X}| + {5: + foo }{24: + bar }{2: }{24:X}| this is fo^o | - {0:~ }|*2 + {1:~ }|*2 | ]]) feed('<2-LeftMouse><20,0>') screen:expect([[ - {tab: + foo + bar }{sel: Name] }{fill: }{tab:X}| - {0:^$} | - {0:~ }|*2 + {24: + foo + bar }{5: Name] }{2: }{24:X}| + {1:^$} | + {1:~ }|*2 | ]]) command('tabclose') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - this is ba^r{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + this is ba^r{1:$} | + {1:~ }|*2 | ]]) feed('<2-LeftMouse><10,0>') screen:expect([[ - {tab: + foo }{sel: Name] }{tab: + bar }{fill: }{tab:X}| - {0:^$} | - {0:~ }|*2 + {24: + foo }{5: Name] }{24: + bar }{2: }{24:X}| + {1:^$} | + {1:~ }|*2 | ]]) end) @@ -509,7 +482,7 @@ describe('ui/mouse/input', function() api.nvim_set_option_value('tabline', '%@Test@test%X-%5@Test2@test2', {}) api.nvim_set_option_value('showtabline', 2, {}) screen:expect([[ - {fill:test-test2 }| + {2:test-test2 }| testing | mouse | support and selectio^n | @@ -594,48 +567,41 @@ describe('ui/mouse/input', function() testing | mo^use | support and selection | - {0:~ }| + {1:~ }| | ]]) feed('<LeftDrag><4,1>') screen:expect([[ testing | - mo{1:us}^e | + mo{17:us}^e | support and selection | - {0:~ }| - {2:-- VISUAL --} | + {1:~ }| + {5:-- VISUAL --} | ]]) feed('<LeftDrag><2,2>') screen:expect([[ testing | - mo{1:use} | - {1:su}^pport and selection | - {0:~ }| - {2:-- VISUAL --} | + mo{17:use} | + {17:su}^pport and selection | + {1:~ }| + {5:-- VISUAL --} | ]]) feed('<LeftDrag><0,0>') screen:expect([[ - ^t{1:esting} | - {1:mou}se | + ^t{17:esting} | + {17:mou}se | support and selection | - {0:~ }| - {2:-- VISUAL --} | + {1:~ }| + {5:-- VISUAL --} | ]]) end) it('left drag changes visual selection after tab click', function() - screen:set_default_attr_ids({ - [0] = { bold = true, foreground = Screen.colors.Blue }, - tab = { background = Screen.colors.LightGrey, underline = true }, - sel = { bold = true }, - fill = { reverse = true }, - vis = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, - }) feed_command('silent file foo | tabnew | file bar') insert('this is bar') feed_command('tabprevious') -- go to first tab screen:expect([[ - {sel: + foo }{tab: + bar }{fill: }{tab:X}| + {5: + foo }{24: + bar }{2: }{24:X}| testing | mouse | support and selectio^n | @@ -645,17 +611,17 @@ describe('ui/mouse/input', function() n.poke_eventloop() feed('<LeftMouse><0,1>') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - ^this is bar{0:$} | - {0:~ }|*2 + {24: + foo }{5: + bar }{2: }{24:X}| + ^this is bar{1:$} | + {1:~ }|*2 :tabprevious | ]]) feed('<LeftDrag><4,1>') screen:expect([[ - {tab: + foo }{sel: + bar }{fill: }{tab:X}| - {vis:this}^ is bar{0:$} | - {0:~ }|*2 - {sel:-- VISUAL --} | + {24: + foo }{5: + bar }{2: }{24:X}| + {17:this}^ is bar{1:$} | + {1:~ }|*2 + {5:-- VISUAL --} | ]]) end) @@ -673,12 +639,12 @@ describe('ui/mouse/input', function() testing │testing | mouse │mouse | support and selection │support and selection | - {0:~ }│{0:~ }|*2 - {0:~ }│{4:[No Name] [+] }| - {0:~ }│foo{0:$} | - {0:~ }│ba^r{0:$} | - {0:~ }│{0:~ }|*4 - {4:[No Name] [+] }{5:[No Name] [+] }| + {1:~ }│{1:~ }|*2 + {1:~ }│{2:[No Name] [+] }| + {1:~ }│foo{1:$} | + {1:~ }│ba^r{1:$} | + {1:~ }│{1:~ }|*4 + {2:[No Name] [+] }{3:[No Name] [+] }| | ]], } @@ -689,12 +655,12 @@ describe('ui/mouse/input', function() testing │testing | mouse │mouse | support and selection │support and selection | - {0:~ }│{0:~ }|*2 - {0:~ }│{4:[No Name] [+] }| - {0:~ }│^foo{0:$} | - {0:~ }│bar{0:$} | - {0:~ }│{0:~ }|*4 - {4:[No Name] [+] }{5:[No Name] [+] }| + {1:~ }│{1:~ }|*2 + {1:~ }│{2:[No Name] [+] }| + {1:~ }│^foo{1:$} | + {1:~ }│bar{1:$} | + {1:~ }│{1:~ }|*4 + {2:[No Name] [+] }{3:[No Name] [+] }| | ]], } @@ -705,13 +671,13 @@ describe('ui/mouse/input', function() testing │testing | mouse │mouse | support and selection │support and selection | - {0:~ }│{0:~ }|*2 - {0:~ }│{4:[No Name] [+] }| - {0:~ }│{1:foo}{3:$} | - {0:~ }│{1:bar}{0:^$} | - {0:~ }│{0:~ }|*4 - {4:[No Name] [+] }{5:[No Name] [+] }| - {2:-- VISUAL --} | + {1:~ }│{1:~ }|*2 + {1:~ }│{2:[No Name] [+] }| + {1:~ }│{17:foo}{100:$} | + {1:~ }│{17:bar}{1:^$} | + {1:~ }│{1:~ }|*4 + {2:[No Name] [+] }{3:[No Name] [+] }| + {5:-- VISUAL --} | ]], } end) @@ -723,33 +689,33 @@ describe('ui/mouse/input', function() screen:expect([[ testing | mouse | - {1:suppor}^t and selection | - {0:~ }| - {2:-- VISUAL --} | + {17:suppor}^t and selection | + {1:~ }| + {5:-- VISUAL --} | ]]) feed('<LeftDrag><0,1>') screen:expect([[ testing | - ^m{1:ouse} | - {1:support} and selection | - {0:~ }| - {2:-- VISUAL --} | + ^m{17:ouse} | + {17:support} and selection | + {1:~ }| + {5:-- VISUAL --} | ]]) feed('<LeftDrag><4,0>') screen:expect([[ - ^t{1:esting} | - {1:mouse} | - {1:support} and selection | - {0:~ }| - {2:-- VISUAL --} | + ^t{17:esting} | + {17:mouse} | + {17:support} and selection | + {1:~ }| + {5:-- VISUAL --} | ]]) feed('<LeftDrag><14,2>') screen:expect([[ testing | mouse | - {1:support and selectio}^n | - {0:~ }| - {2:-- VISUAL --} | + {17:support and selectio}^n | + {1:~ }| + {5:-- VISUAL --} | ]]) end) @@ -762,33 +728,33 @@ describe('ui/mouse/input', function() screen:expect([[ testing | mouse | - {1:su}^p{1:port and selection} | - {0:~ }| - {2:-- VISUAL LINE --} | + {17:su}^p{17:port and selection} | + {1:~ }| + {5:-- VISUAL LINE --} | ]]) feed('<LeftDrag><0,1>') screen:expect([[ testing | - ^m{1:ouse} | - {1:support and selection} | - {0:~ }| - {2:-- VISUAL LINE --} | + ^m{17:ouse} | + {17:support and selection} | + {1:~ }| + {5:-- VISUAL LINE --} | ]]) feed('<LeftDrag><4,0>') screen:expect([[ - {1:test}^i{1:ng} | - {1:mouse} | - {1:support and selection} | - {0:~ }| - {2:-- VISUAL LINE --} | + {17:test}^i{17:ng} | + {17:mouse} | + {17:support and selection} | + {1:~ }| + {5:-- VISUAL LINE --} | ]]) feed('<LeftDrag><14,2>') screen:expect([[ testing | mouse | - {1:support and se}^l{1:ection} | - {0:~ }| - {2:-- VISUAL LINE --} | + {17:support and se}^l{17:ection} | + {1:~ }| + {5:-- VISUAL LINE --} | ]]) end) @@ -804,32 +770,32 @@ describe('ui/mouse/input', function() testing | mouse | su^pport and selection | - {0:~ }| - {2:-- VISUAL BLOCK --} | + {1:~ }| + {5:-- VISUAL BLOCK --} | ]]) feed('<LeftDrag><0,1>') screen:expect([[ testing | - ^m{1:ou}se | - {1:sup}port and selection | - {0:~ }| - {2:-- VISUAL BLOCK --} | + ^m{17:ou}se | + {17:sup}port and selection | + {1:~ }| + {5:-- VISUAL BLOCK --} | ]]) feed('<LeftDrag><4,0>') screen:expect([[ - te{1:st}^ing | - mo{1:use} | - su{1:ppo}rt and selection | - {0:~ }| - {2:-- VISUAL BLOCK --} | + te{17:st}^ing | + mo{17:use} | + su{17:ppo}rt and selection | + {1:~ }| + {5:-- VISUAL BLOCK --} | ]]) feed('<LeftDrag><14,2>') screen:expect([[ testing | mouse | - su{1:pport and se}^lection | - {0:~ }| - {2:-- VISUAL BLOCK --} | + su{17:pport and se}^lection | + {1:~ }| + {5:-- VISUAL BLOCK --} | ]]) end) @@ -839,16 +805,16 @@ describe('ui/mouse/input', function() ^testing | mouse | support and selection | - {0:~ }| + {1:~ }| | ]]) feed('<RightMouse><2,2>') screen:expect([[ - {1:testing} | - {1:mouse} | - {1:su}^pport and selection | - {0:~ }| - {2:-- VISUAL --} | + {17:testing} | + {17:mouse} | + {17:su}^pport and selection | + {1:~ }| + {5:-- VISUAL --} | ]]) end) @@ -856,11 +822,11 @@ describe('ui/mouse/input', function() api.nvim_set_option_value('tags', './non-existent-tags-file', {}) feed('<C-LeftMouse><0,0>') screen:expect([[ - {6:E433: No tags file} | - {6:E426: Tag not found: test}| - {6:ing} | - {7:Press ENTER or type comma}| - {7:nd to continue}^ | + {9:E433: No tags file} | + {9:E426: Tag not found: test}| + {9:ing} | + {6:Press ENTER or type comma}| + {6:nd to continue}^ | ]]) feed('<cr>') end) @@ -890,54 +856,54 @@ describe('ui/mouse/input', function() local oldwin = api.nvim_get_current_win() command('rightbelow vnew') screen:expect([[ - testing │{0:^$} | - mouse │{0:~ }| - support and selection │{0:~ }| - {4:[No Name] [+] }{5:[No Name] }| + testing │{1:^$} | + mouse │{1:~ }| + support and selection │{1:~ }| + {2:[No Name] [+] }{3:[No Name] }| | ]]) api.nvim_input_mouse('left', 'press', '', 0, 0, 22) poke_eventloop() api.nvim_input_mouse('left', 'drag', '', 0, 1, 12) screen:expect([[ - testing │{0:^$} | - mouse │{0:~ }| - support and │{0:~ }| - {4:< Name] [+] }{5:[No Name] }| + testing │{1:^$} | + mouse │{1:~ }| + support and │{1:~ }| + {2:< Name] [+] }{3:[No Name] }| | ]]) api.nvim_input_mouse('left', 'drag', '', 0, 2, 2) screen:expect([[ - te│{0:^$} | - mo│{0:~ }| - su│{0:~ }| - {4:< }{5:[No Name] }| + te│{1:^$} | + mo│{1:~ }| + su│{1:~ }| + {2:< }{3:[No Name] }| | ]]) api.nvim_input_mouse('left', 'release', '', 0, 2, 2) api.nvim_set_option_value('statuscolumn', 'foobar', { win = oldwin }) screen:expect([[ - {8:fo}│{0:^$} | - {8:fo}│{0:~ }|*2 - {4:< }{5:[No Name] }| + {8:fo}│{1:^$} | + {8:fo}│{1:~ }|*2 + {2:< }{3:[No Name] }| | ]]) api.nvim_input_mouse('left', 'press', '', 0, 0, 2) poke_eventloop() api.nvim_input_mouse('left', 'drag', '', 0, 1, 12) screen:expect([[ - {8:foobar}testin│{0:^$} | - {8:foobar}mouse │{0:~ }| - {8:foobar}suppor│{0:~ }| - {4:< Name] [+] }{5:[No Name] }| + {8:foobar}testin│{1:^$} | + {8:foobar}mouse │{1:~ }| + {8:foobar}suppor│{1:~ }| + {2:< Name] [+] }{3:[No Name] |