aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/mouse_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-01-13 12:10:26 +0100
committerGitHub <noreply@github.com>2019-01-13 12:10:26 +0100
commita7fc01a532e753e2f5a7d0f2b8f670144d78a878 (patch)
tree36060b7fdfb919a7f36faf0dad9790a95088c0e7 /test/functional/ui/mouse_spec.lua
parent424388c207eaf6b5f564ff8247b5800ab337bc56 (diff)
parent23c71d5182a5e717c3a1852d9d3c90e81b4735fd (diff)
downloadrneovim-a7fc01a532e753e2f5a7d0f2b8f670144d78a878.tar.gz
rneovim-a7fc01a532e753e2f5a7d0f2b8f670144d78a878.tar.bz2
rneovim-a7fc01a532e753e2f5a7d0f2b8f670144d78a878.zip
Merge pull request #9492 from bfredl/cul_cole
redraw: share more code between cursorline and conceal redraws. Add tests for conceal cursor
Diffstat (limited to 'test/functional/ui/mouse_spec.lua')
-rw-r--r--test/functional/ui/mouse_spec.lua73
1 files changed, 72 insertions, 1 deletions
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua
index c531f838c1..3890f0f7ba 100644
--- a/test/functional/ui/mouse_spec.lua
+++ b/test/functional/ui/mouse_spec.lua
@@ -741,10 +741,11 @@ describe('ui/mouse/input', function()
screen:set_default_attr_ids({
[0] = {bold=true, foreground=Screen.colors.Blue},
c = { foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray },
+ sm = {bold = true},
})
feed('ggdG')
- feed_command('set concealcursor=n')
+ feed_command('set concealcursor=ni')
feed_command('set nowrap')
feed_command('set shiftwidth=2 tabstop=4 list listchars=tab:>-')
feed_command('syntax match NonText "\\*" conceal')
@@ -973,6 +974,76 @@ describe('ui/mouse/input', function()
]])
end) -- level 2 - non wrapped
+ it('(level 2) click on non-wrapped lines (insert mode)', function()
+ feed_command('let &conceallevel=2', 'echo')
+
+ feed('<esc>i<LeftMouse><20,0>')
+ screen:expect([[
+ Section{0:>>--->--->---}^t1 |
+ {0:>--->--->---} t2 t3 t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
+ |
+ {0:~ }|
+ {0:~ }|
+ {sm:-- INSERT --} |
+ ]])
+
+ feed('<LeftMouse><14,1>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} ^t2 t3 t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
+ |
+ {0:~ }|
+ {0:~ }|
+ {sm:-- INSERT --} |
+ ]])
+
+ feed('<LeftMouse><18,1>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t^3 t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
+ |
+ {0:~ }|
+ {0:~ }|
+ {sm:-- INSERT --} |
+ ]])
+
+ feed('<LeftMouse><0,2>') -- Weirdness
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 t4 |
+ {c:^>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
+ |
+ {0:~ }|
+ {0:~ }|
+ {sm:-- INSERT --} |
+ ]])
+
+ feed('<LeftMouse><8,2>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 t4 |
+ {c:>} 私は猫^が大好き{0:>---}{c:X} ✨{0:>}|
+ |
+ {0:~ }|
+ {0:~ }|
+ {sm:-- INSERT --} |
+ ]])
+
+ feed('<LeftMouse><20,2>')
+ screen:expect([[
+ Section{0:>>--->--->---}t1 |
+ {0:>--->--->---} t2 t3 t4 |
+ {c:>} 私は猫が大好き{0:>---}{c:^X} ✨{0:>}|
+ |
+ {0:~ }|
+ {0:~ }|
+ {sm:-- INSERT --} |
+ ]])
+ end) -- level 2 - non wrapped (insert mode)
+
it('(level 2) click on wrapped lines', function()
feed_command('let &conceallevel=2', 'let &wrap=1', 'echo')