aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/mouse_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui/mouse_spec.lua')
-rw-r--r--test/functional/ui/mouse_spec.lua560
1 files changed, 366 insertions, 194 deletions
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua
index ecbd5642d1..debd324977 100644
--- a/test/functional/ui/mouse_spec.lua
+++ b/test/functional/ui/mouse_spec.lua
@@ -1,10 +1,9 @@
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear, feed, meths = helpers.clear, helpers.feed, helpers.meths
-local insert, execute = helpers.insert, helpers.execute
+local insert, feed_command = helpers.insert, helpers.feed_command
local eq, funcs = helpers.eq, helpers.funcs
-
-if helpers.pending_win32(pending) then return end
+local command = helpers.command
describe('ui/mouse/input', function()
local screen
@@ -13,9 +12,6 @@ describe('ui/mouse/input', function()
clear()
meths.set_option('mouse', 'a')
meths.set_option('listchars', 'eol:$')
- -- set mousetime to very high value to ensure that even in valgrind/travis,
- -- nvim will still pick multiple clicks
- meths.set_option('mousetime', 5000)
screen = Screen.new(25, 5)
screen:attach()
screen:set_default_attr_ids({
@@ -30,6 +26,7 @@ describe('ui/mouse/input', function()
[4] = {reverse = true},
[5] = {bold = true, reverse = true},
})
+ command("set display-=msgsep")
feed('itesting<cr>mouse<cr>support and selection<esc>')
screen:expect([[
testing |
@@ -119,13 +116,12 @@ describe('ui/mouse/input', function()
sel = { bold=true },
fill = { reverse=true }
})
- screen.timeout = 15000
end)
it('in tabline on filler space moves tab to the end', function()
- execute('%delete')
+ feed_command('%delete')
insert('this is foo')
- execute('silent file foo | tabnew | file bar')
+ feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
@@ -160,9 +156,9 @@ describe('ui/mouse/input', function()
return
end
- execute('%delete')
+ feed_command('%delete')
insert('this is foo')
- execute('silent file foo | tabnew | file bar')
+ feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
@@ -190,9 +186,9 @@ describe('ui/mouse/input', function()
end)
it('in tabline to the right moves tab right', function()
- execute('%delete')
+ feed_command('%delete')
insert('this is foo')
- execute('silent file foo | tabnew | file bar')
+ feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
@@ -220,9 +216,9 @@ describe('ui/mouse/input', function()
end)
it('out of tabline under filler space moves tab to the end', function()
- execute('%delete')
+ feed_command('%delete')
insert('this is foo')
- execute('silent file foo | tabnew | file bar')
+ feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
@@ -265,9 +261,9 @@ describe('ui/mouse/input', function()
return
end
- execute('%delete')
+ feed_command('%delete')
insert('this is foo')
- execute('silent file foo | tabnew | file bar')
+ feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
@@ -303,9 +299,9 @@ describe('ui/mouse/input', function()
end)
it('out of tabline to the right moves tab right', function()
- execute('%delete')
+ feed_command('%delete')
insert('this is foo')
- execute('silent file foo | tabnew | file bar')
+ feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
@@ -352,9 +348,9 @@ describe('ui/mouse/input', function()
end)
it('left click in default tabline (position 4) switches to tab', function()
- execute('%delete')
+ feed_command('%delete')
insert('this is foo')
- execute('silent file foo | tabnew | file bar')
+ feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
@@ -375,9 +371,9 @@ describe('ui/mouse/input', function()
it('left click in default tabline (position 24) closes tab', function()
meths.set_option('hidden', true)
- execute('%delete')
+ feed_command('%delete')
insert('this is foo')
- execute('silent file foo | tabnew | file bar')
+ feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
@@ -398,9 +394,9 @@ describe('ui/mouse/input', function()
it('double click in default tabline (position 4) opens new tab', function()
meths.set_option('hidden', true)
- execute('%delete')
+ feed_command('%delete')
insert('this is foo')
- execute('silent file foo | tabnew | file bar')
+ feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
@@ -421,13 +417,13 @@ describe('ui/mouse/input', function()
describe('%@ label', function()
before_each(function()
- execute([[
+ feed_command([[
function Test(...)
let g:reply = a:000
return copy(a:000) " Check for memory leaks: return should be freed
endfunction
]])
- execute([[
+ feed_command([[
function Test2(...)
return call('Test', a:000 + [2])
endfunction
@@ -533,9 +529,9 @@ describe('ui/mouse/input', function()
fill = { reverse=true },
vis = { background=Screen.colors.LightGrey }
})
- execute('silent file foo | tabnew | file bar')
+ feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
- execute('tabprevious') -- go to first tab
+ feed_command('tabprevious') -- go to first tab
screen:expect([[
{sel: + foo }{tab: + bar }{fill: }{tab:X}|
mouse |
@@ -641,14 +637,14 @@ describe('ui/mouse/input', function()
mouse scrolling
]])
screen:try_resize(53, 14)
- execute('sp', 'vsp')
+ feed_command('sp', 'vsp')
screen:expect([[
- lines {4:|}lines |
- to {4:|}to |
- test {4:|}test |
- mouse scrolling {4:|}mouse scrolling |
- ^ {4:|} |
- {0:~ }{4:|}{0:~ }|
+ lines {4:│}lines |
+ to {4:│}to |
+ test {4:│}test |
+ mouse scrolling {4:│}mouse scrolling |
+ ^ {4:│} |
+ {0:~ }{4:│}{0:~ }|
{5:[No Name] [+] }{4:[No Name] [+] }|
to |
test |
@@ -660,12 +656,12 @@ describe('ui/mouse/input', function()
]])
feed('<ScrollWheelDown><0,0>')
screen:expect([[
- mouse scrolling {4:|}lines |
- ^ {4:|}to |
- {0:~ }{4:|}test |
- {0:~ }{4:|}mouse scrolling |
- {0:~ }{4:|} |
- {0:~ }{4:|}{0:~ }|
+ mouse scrolling {4:│}lines |
+ ^ {4:│}to |
+ {0:~ }{4:│}test |
+ {0:~ }{4:│}mouse scrolling |
+ {0:~ }{4:│} |
+ {0:~ }{4:│}{0:~ }|
{5:[No Name] [+] }{4:[No Name] [+] }|
to |
test |
@@ -677,12 +673,12 @@ describe('ui/mouse/input', function()
]])
feed('<ScrollWheelUp><27,0>')
screen:expect([[
- mouse scrolling {4:|}text |
- ^ {4:|}with |
- {0:~ }{4:|}many |
- {0:~ }{4:|}lines |
- {0:~ }{4:|}to |
- {0:~ }{4:|}test |
+ mouse scrolling {4:│}text |
+ ^ {4:│}with |
+ {0:~ }{4:│}many |
+ {0:~ }{4:│}lines |
+ {0:~ }{4:│}to |
+ {0:~ }{4:│}test |
{5:[No Name] [+] }{4:[No Name] [+] }|
to |
test |
@@ -694,12 +690,12 @@ describe('ui/mouse/input', function()
]])
feed('<ScrollWheelUp><27,7><ScrollWheelUp>')
screen:expect([[
- mouse scrolling {4:|}text |
- ^ {4:|}with |
- {0:~ }{4:|}many |
- {0:~ }{4:|}lines |
- {0:~ }{4:|}to |
- {0:~ }{4:|}test |
+ mouse scrolling {4:│}text |
+ ^ {4:│}with |
+ {0:~ }{4:│}many |
+ {0:~ }{4:│}lines |
+ {0:~ }{4:│}to |
+ {0:~ }{4:│}test |
{5:[No Name] [+] }{4:[No Name] [+] }|
Inserting |
text |
@@ -712,6 +708,7 @@ describe('ui/mouse/input', function()
end)
it('horizontal scrolling', function()
+ command('set sidescroll=0')
feed("<esc>:set nowrap<cr>")
feed("a <esc>20Ab<esc>")
@@ -754,309 +751,484 @@ describe('ui/mouse/input', function()
})
feed('ggdG')
- execute('set concealcursor=n')
- execute('set nowrap')
- execute('syntax match NonText "\\<amet\\>" conceal')
- execute('syntax match NonText "\\cs\\|g." conceal cchar=X')
- execute('syntax match NonText "\\%(lo\\|cl\\)." conceal')
- execute('syntax match NonText "Lo" conceal cchar=Y')
+ feed_command('set concealcursor=n')
+ feed_command('set nowrap')
+ feed_command('set shiftwidth=2 tabstop=4 list listchars=tab:>-')
+ feed_command('syntax match NonText "\\*" conceal')
+ feed_command('syntax match NonText "cats" conceal cchar=X')
+ feed_command('syntax match NonText "x" conceal cchar=>')
+ -- First column is there to retain the tabs.
insert([[
- Lorem ipsum dolor sit amet, consetetur sadipscing elitr.
- Stet clita kasd gubergren, no sea takimata sanctus est.
+ |Section *t1*
+ | *t2* *t3* *t4*
+ |x 私は猫が大好き *cats* ✨🐈✨
]])
- feed('gg')
+ feed('gg<c-v>Gxgg')
end)
it('(level 1) click on non-wrapped lines', function()
- execute('let &conceallevel=1', 'echo')
+ feed_command('let &conceallevel=1', 'echo')
feed('<esc><LeftMouse><0,0>')
screen:expect([[
- {c:^Y}rem ip{c:X}um do{c: } {c:X}it {c: }, con|
- {c:X}tet {c: }ta ka{c:X}d {c:X}ber{c:X}en, no|
+ ^Section{0:>>--->--->---}{c: }t1{c: } |
+ {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
+ {c:>} 私は猫が大好き{0:>---}{c: X } {0:>}|
|
{0:~ }|
{0:~ }|
- {0:~ }|
|
]])
feed('<esc><LeftMouse><1,0>')
screen:expect([[
- {c:Y}^rem ip{c:X}um do{c: } {c:X}it {c: }, con|
- {c:X}tet {c: }ta ka{c:X}d {c:X}ber{c:X}en, no|
+ S^ection{0:>>--->--->---}{c: }t1{c: } |
+ {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
+ {c:>} 私は猫が大好き{0:>---}{c: X } {0:>}|
|
{0:~ }|
{0:~ }|
+ |
+ ]])
+
+ feed('<esc><LeftMouse><21,0>')
+ screen:expect([[
+ Section{0:>>--->--->---}{c: }^t1{c: } |
+ {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
+ {c:>} 私は猫が大好き{0:>---}{c: X } {0:>}|
+ |
+ {0:~ }|
{0:~ }|
|
]])
- feed('<esc><LeftMouse><15,0>')
+ feed('<esc><LeftMouse><21,1>')
screen:expect([[
- {c:Y}rem ip{c:X}um do{c: } {c:^X}it {c: }, con|
- {c:X}tet {c: }ta ka{c:X}d {c:X}ber{c:X}en, no|
+ Section{0:>>--->--->---}{c: }t1{c: } |
+ {0:>--->--->---} {c: }t2{c: } {c: }t^3{c: } {c: }|
+ {c:>} 私は猫が大好き{0:>---}{c: X } {0:>}|
|
{0:~ }|
{0:~ }|
+ |
+ ]])
+
+ feed('<esc><LeftMouse><0,2>')
+ screen:expect([[
+ Section{0:>>--->--->---}{c: }t1{c: } |
+ {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
+ {c:^>} 私は猫が大好き{0:>---}{c: X } {0:>}|
+ |
+ {0:~ }|
{0:~ }|
|
]])
- feed('<esc><LeftMouse><15,1>')
+ feed('<esc><LeftMouse><7,2>')
screen:expect([[
- {c:Y}rem ip{c:X}um do{c: } {c:X}it {c: }, con|
- {c:X}tet {c: }ta ka{c:X}d {c:X}^ber{c:X}en, no|
+ Section{0:>>--->--->---}{c: }t1{c: } |
+ {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
+ {c:>} 私は^猫が大好き{0:>---}{c: X } {0:>}|
|
{0:~ }|
{0:~ }|
+ |
+ ]])
+
+ feed('<esc><LeftMouse><21,2>')
+ screen:expect([[
+ Section{0:>>--->--->---}{c: }t1{c: } |
+ {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
+ {c:>} 私は猫が大好き{0:>---}{c: ^X } {0:>}|
+ |
+ {0:~ }|
{0:~ }|
|
]])
+
end) -- level 1 - non wrapped
it('(level 1) click on wrapped lines', function()
- execute('let &conceallevel=1', 'let &wrap=1', 'echo')
+ feed_command('let &conceallevel=1', 'let &wrap=1', 'echo')
- feed('<esc><LeftMouse><0,0>')
+ feed('<esc><LeftMouse><24,1>')
screen:expect([[
- {c:^Y}rem ip{c:X}um do{c: } {c:X}it {c: } |
- , con{c:X}etetur {c:X}adip{c:X}cin{c:X} |
- elitr. |
- {c:X}tet {c: }ta ka{c:X}d {c:X}ber{c:X}en |
- , no {c:X}ea takimata {c:X}anctu{c:X}|
- e{c:X}t. |
+ Section{0:>>--->--->---}{c: }t1{c: } |
+ {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c:^ }|
+ t4{c: } |
+ {c:>} 私は猫が大好き{0:>---}{c: X} |
+ {c: } ✨🐈✨ |
+ |
|
]])
- feed('<esc><LeftMouse><6,1>')
+ feed('<esc><LeftMouse><0,2>')
screen:expect([[
- {c:Y}rem ip{c:X}um do{c: } {c:X}it {c: } |
- , con{c:X}^etetur {c:X}adip{c:X}cin{c:X} |
- elitr. |
- {c:X}tet {c: }ta ka{c:X}d {c:X}ber{c:X}en |
- , no {c:X}ea takimata {c:X}anctu{c:X}|
- e{c:X}t. |
+ Section{0:>>--->--->---}{c: }t1{c: } |
+ {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
+ ^t4{c: } |
+ {c:>} 私は猫が大好き{0:>---}{c: X} |
+ {c: } ✨🐈✨ |
+ |
|
]])
- feed('<esc><LeftMouse><15,1>')
+ feed('<esc><LeftMouse><8,3>')
screen:expect([[
- {c:Y}rem ip{c:X}um do{c: } {c:X}it {c: } |
- , con{c:X}etetur {c:X}a^dip{c:X}cin{c:X} |
- elitr. |
- {c:X}tet {c: }ta ka{c:X}d {c:X}ber{c:X}en |
- , no {c:X}ea takimata {c:X}anctu{c:X}|
- e{c:X}t. |
+ Section{0:>>--->--->---}{c: }t1{c: } |
+ {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
+ t4{c: } |
+ {c:>} 私は猫^が大好き{0:>---}{c: X} |
+ {c: } ✨🐈✨ |
+ |
|
]])
- feed('<esc><LeftMouse><15,3>')
+ feed('<esc><LeftMouse><21,3>')
screen:expect([[
- {c:Y}rem ip{c:X}um do{c: } {c:X}it {c: } |
- , con{c:X}etetur {c:X}adip{c:X}cin{c:X} |
- elitr. |
- {c:X}tet {c: }ta ka{c:X}d {c:X}^ber{c:X}en |
- , no {c:X}ea takimata {c:X}anctu{c:X}|
- e{c:X}t. |
+ Section{0:>>--->--->---}{c: }t1{c: } |
+ {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
+ t4{c: } |
+ {c:>} 私は猫が大好き{0:>---}{c: ^X} |
+ {c: } ✨🐈✨ |
+ |
+ |
+ ]])
+
+ feed('<esc><LeftMouse><4,4>')
+ screen:expect([[
+ Section{0:>>--->--->---}{c: }t1{c: } |
+ {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
+ t4{c: } |
+ {c:>} 私は猫が大好き{0:>---}{c: X} |
+ {c: } ✨^🐈✨ |
+ |
|
]])
end) -- level 1 - wrapped
it('(level 2) click on non-wrapped lines', function()
- execute('let &conceallevel=2', 'echo')
+ feed_command('let &conceallevel=2', 'echo')
- feed('<esc><LeftMouse><0,0>')
+ feed('<esc><LeftMouse><20,0>')
screen:expect([[
- {c:^Y}rem ip{c:X}um do {c:X}it , con{c:X}e|
- {c:X}tet ta ka{c:X}d {c:X}ber{c:X}en, no |
+ Section{0:>>--->--->---}^t1 |
+ {0:>--->--->---} t2 t3 t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
|
{0:~ }|
{0:~ }|
- {0:~ }|
|
]])
- feed('<esc><LeftMouse><1,0>')
+ feed('<esc><LeftMouse><14,1>')
screen:expect([[
- {c:Y}^rem ip{c:X}um do {c:X}it , con{c:X}e|
- {c:X}tet ta ka{c:X}d {c:X}ber{c:X}en, no |
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} ^t2 t3 t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
|
{0:~ }|
{0:~ }|
- {0:~ }|
|
]])
- feed('<esc><LeftMouse><15,0>')
+ feed('<esc><LeftMouse><18,1>')
screen:expect([[
- {c:Y}rem ip{c:X}um do {c:X}^it , con{c:X}e|
- {c:X}tet ta ka{c:X}d {c:X}ber{c:X}en, no |
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t^3 t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
|
{0:~ }|
{0:~ }|
+ |
+ ]])
+
+ feed('<esc><LeftMouse><0,2>') -- Weirdness
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 t4 |
+ {c:^>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
+ |
+ {0:~ }|
{0:~ }|
|
]])
- feed('<esc><LeftMouse><15,1>')
+ feed('<esc><LeftMouse><8,2>')
screen:expect([[
- {c:Y}rem ip{c:X}um do {c:X}it , con{c:X}e|
- {c:X}tet ta ka{c:X}d {c:X}b^er{c:X}en, no |
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 t4 |
+ {c:>} 私は猫^が大好き{0:>---}{c:X} ✨{0:>}|
|
{0:~ }|
{0:~ }|
+ |
+ ]])
+
+ feed('<esc><LeftMouse><20,2>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:^X} ✨{0:>}|
+ |
+ {0:~ }|
{0:~ }|
|
]])
end) -- level 2 - non wrapped
it('(level 2) click on wrapped lines', function()
- execute('let &conceallevel=2', 'let &wrap=1', 'echo')
+ feed_command('let &conceallevel=2', 'let &wrap=1', 'echo')
- feed('<esc><LeftMouse><0,0>')
+ feed('<esc><LeftMouse><20,0>')
screen:expect([[
- {c:^Y}rem ip{c:X}um do {c:X}it |
- , con{c:X}etetur {c:X}adip{c:X}cin{c:X} |
- elitr. |
- {c:X}tet ta ka{c:X}d {c:X}ber{c:X}en |
- , no {c:X}ea takimata {c:X}anctu{c:X}|
- e{c:X}t. |
+ Section{0:>>--->--->---}^t1 |
+ {0:>--->--->---} t2 t3 |
+ t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:X} |
+ ✨🐈✨ |
+ |
|
]])
- feed('<esc><LeftMouse><6,1>')
+ feed('<esc><LeftMouse><14,1>')
screen:expect([[
- {c:Y}rem ip{c:X}um do {c:X}it |
- , con{c:X}^etetur {c:X}adip{c:X}cin{c:X} |
- elitr. |
- {c:X}tet ta ka{c:X}d {c:X}ber{c:X}en |
- , no {c:X}ea takimata {c:X}anctu{c:X}|
- e{c:X}t. |
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} ^t2 t3 |
+ t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:X} |
+ ✨🐈✨ |
+ |
|
]])
- feed('<esc><LeftMouse><15,1>')
+ feed('<esc><LeftMouse><18,1>')
screen:expect([[
- {c:Y}rem ip{c:X}um do {c:X}it |
- , con{c:X}etetur {c:X}a^dip{c:X}cin{c:X} |
- elitr. |
- {c:X}tet ta ka{c:X}d {c:X}ber{c:X}en |
- , no {c:X}ea takimata {c:X}anctu{c:X}|
- e{c:X}t. |
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t^3 |
+ t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:X} |
+ ✨🐈✨ |
+ |
|
]])
- feed('<esc><LeftMouse><15,3>')
+ -- NOTE: The click would ideally be on the 't' in 't4', but wrapping
+ -- caused the invisible '*' right before 't4' to remain on the previous
+ -- screen line. This is being treated as expected because fixing this is
+ -- out of scope for mouse clicks. Should the wrapping behavior of
+ -- concealed characters change in the future, this case should be
+ -- reevaluated.
+ feed('<esc><LeftMouse><0,2>')
screen:expect([[
- {c:Y}rem ip{c:X}um do {c:X}it |
- , con{c:X}etetur {c:X}adip{c:X}cin{c:X} |
- elitr. |
- {c:X}tet ta ka{c:X}d {c:X}b^er{c:X}en |
- , no {c:X}ea takimata {c:X}anctu{c:X}|
- e{c:X}t. |
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 ^ |
+ t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:X} |
+ ✨🐈✨ |
+ |
+ |
+ ]])
+
+ feed('<esc><LeftMouse><1,2>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 |
+ t^4 |
+ {c:>} 私は猫が大好き{0:>---}{c:X} |
+ ✨🐈✨ |
+ |
+ |
+ ]])
+
+ feed('<esc><LeftMouse><0,3>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 |
+ t4 |
+ {c:^>} 私は猫が大好き{0:>---}{c:X} |
+ ✨🐈✨ |
+ |
+ |
+ ]])
+
+ feed('<esc><LeftMouse><20,3>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 |
+ t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:^X} |
+ ✨🐈✨ |
+ |
+ |
+ ]])
+
+ feed('<esc><LeftMouse><1,4>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 |
+ t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:X} |
+ ^✨🐈✨ |
+ |
+ |
+ ]])
+
+ feed('<esc><LeftMouse><5,4>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 |
+ t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:X} |
+ ✨🐈^✨ |
+ |
|
]])
end) -- level 2 - wrapped
it('(level 3) click on non-wrapped lines', function()
- execute('let &conceallevel=3', 'echo')
+ feed_command('let &conceallevel=3', 'echo')
- feed('<esc><LeftMouse><0,0>')
+ feed('<esc><LeftMouse><0,2>')
screen:expect([[
- ^rem ipum do it , conetetu|
- tet ta kad beren, no ea t|
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 t4 |
+ ^ 私は猫が大好き{0:>----} ✨🐈|
|
{0:~ }|
{0:~ }|
- {0:~ }|
|
]])
- feed('<esc><LeftMouse><1,0>')
+ feed('<esc><LeftMouse><1,2>')
screen:expect([[
- r^em ipum do it , conetetu|
- tet ta kad beren, no ea t|
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 t4 |
+ ^私は猫が大好き{0:>----} ✨🐈|
|
{0:~ }|
{0:~ }|
- {0:~ }|
|
]])
- feed('<esc><LeftMouse><15,0>')
+ feed('<esc><LeftMouse><13,2>')
screen:expect([[
- rem ipum do it ^, conetetu|
- tet ta kad beren, no ea t|
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 t4 |
+ 私は猫が大好^き{0:>----} ✨🐈|
|
{0:~ }|
{0:~ }|
- {0:~ }|
|
]])
- feed('<esc><LeftMouse><15,1>')
+ feed('<esc><LeftMouse><20,2>')
screen:expect([[
- rem ipum do it , conetetu|
- tet ta kad bere^n, no ea t|
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 t4 |
+ 私は猫が大好き{0:>----}^ ✨🐈|
|
{0:~ }|
{0:~ }|
- {0:~ }|
|
]])
end) -- level 3 - non wrapped
it('(level 3) click on wrapped lines', function()
- execute('let &conceallevel=3', 'let &wrap=1', 'echo')
+ feed_command('let &conceallevel=3', 'let &wrap=1', 'echo')
- feed('<esc><LeftMouse><0,0>')
+ feed('<esc><LeftMouse><14,1>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} ^t2 t3 |
+ t4 |
+ 私は猫が大好き{0:>----} |
+ ✨🐈✨ |
+ |
+ |
+ ]])
+
+ feed('<esc><LeftMouse><18,1>')
screen:expect([[
- ^rem ipum do it |
- , conetetur adipcin |
- elitr. |
- tet ta kad beren |
- , no ea takimata anctu |
- et. |
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t^3 |
+ t4 |
+ 私は猫が大好き{0:>----} |
+ ✨🐈✨ |
+ |
|
]])
- feed('<esc><LeftMouse><6,1>')
+ feed('<esc><LeftMouse><1,2>')
screen:expect([[
- rem ipum do it |
- , cone^tetur adipcin |
- elitr. |
- tet ta kad beren |
- , no ea takimata anctu |
- et. |
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 |
+ t^4 |
+ 私は猫が大好き{0:>----} |
+ ✨🐈✨ |
+ |
|
]])
- feed('<esc><LeftMouse><15,1>')
+ feed('<esc><LeftMouse><0,3>')
screen:expect([[
- rem ipum do it |
- , conetetur adi^pcin |
- elitr. |
- tet ta kad beren |
- , no ea takimata anctu |
- et. |
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 |
+ t4 |
+ ^ 私は猫が大好き{0:>----} |
+ ✨🐈✨ |
+ |
|
]])
- feed('<esc><LeftMouse><15,3>')
+ feed('<esc><LeftMouse><20,3>')
screen:expect([[
- rem ipum do it |
- , conetetur adipcin |
- elitr. |
- tet ta kad bere^n |
- , no ea takimata anctu |
- et. |
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 |
+ t4 |
+ 私は猫が大好き{0:>----}^ |
+ ✨🐈✨ |
+ |
|
]])
+
+ feed('<esc><LeftMouse><1,4>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 |
+ t4 |
+ 私は猫が大好き{0:>----} |
+ ^✨🐈✨ |
+ |
+ |
+ ]])
+
+ feed('<esc><LeftMouse><3,4>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 |
+ t4 |
+ 私は猫が大好き{0:>----} |
+ ✨^🐈✨ |
+ |
+ |
+ ]])
+
+ feed('<esc><LeftMouse><5,4>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 |
+ t4 |
+ 私は猫が大好き{0:>----} |
+ ✨🐈^✨ |
+ |
+ |
+ ]])
+
end) -- level 3 - wrapped
end)
end)