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