visual_spec.lua (1813B)
1 local n = require('test.functional.testnvim')() 2 local Screen = require('test.functional.ui.screen') 3 4 local clear = n.clear 5 local feed = n.feed 6 local exec = n.exec 7 8 before_each(clear) 9 10 describe('Visual highlight', function() 11 local screen 12 13 before_each(function() 14 screen = Screen.new(50, 6) 15 end) 16 17 -- oldtest: Test_visual_block_with_virtualedit() 18 it('shows selection correctly with virtualedit=block', function() 19 exec([[ 20 call setline(1, ['aaaaaa', 'bbbb', 'cc']) 21 set virtualedit=block 22 normal G 23 ]]) 24 25 feed('<C-V>gg$') 26 screen:expect([[ 27 {17:aaaaaa}^ | 28 {17:bbbb } | 29 {17:cc } | 30 {1:~ }|*2 31 {5:-- VISUAL BLOCK --} | 32 ]]) 33 34 feed('<Esc>gg<C-V>G$') 35 screen:expect([[ 36 {17:aaaaaa } | 37 {17:bbbb } | 38 {17:cc}^ {17: } | 39 {1:~ }|*2 40 {5:-- VISUAL BLOCK --} | 41 ]]) 42 end) 43 44 -- oldtest: Test_visual_hl_with_showbreak() 45 it("with cursor at end of screen line and 'showbreak'", function() 46 exec([[ 47 setlocal showbreak=+ 48 call setline(1, repeat('a', &columns + 10)) 49 normal g$v4lo 50 ]]) 51 52 screen:expect([[ 53 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa^a| 54 {1:+}{17:aaaa}aaaaaa | 55 {1:~ }|*3 56 {5:-- VISUAL --} | 57 ]]) 58 end) 59 end)