robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
e5aac37eb3
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 exec =n . exec 8local feed =n . feed 9 10before_each ( clear ) 11 12describe ( 'tabline' , function () 13local screen 14 15before_each ( function () 16screen =Screen . new ( 50 , 7 ) 17end ) 18 19-- oldtest: Test_tabline_showcmd() 20it ( 'showcmdloc=tabline works' , function () 21exec ( [[ 22func MyTabLine() 23return '%S' 24endfunc 25 26set showcmd 27set showtabline=2 28set tabline=%!MyTabLine() 29set showcmdloc=tabline 30call setline(1, ['a', 'b', 'c']) 31set foldopen+=jump 321,2fold 333 34]] ) 35 36feed ( 'g' ) 37screen : expect ( [[ 38{2:g }| 39{13:+-- 2 lines: a···································}| 40^c | 41{1:~ }|*3 42| 43]] ) 44 45-- typing "gg" should open the fold 46feed ( 'g' ) 47screen : expect ( [[ 48{2: }| 49^a | 50b | 51c | 52{1:~ }|*2 53| 54]] ) 55 56feed ( '<C-V>Gl' ) 57screen : expect ( [[ 58{2:3x2 }| 59{17:a} | 60{17:b} | 61{17:c}^ | 62{1:~ }|*2 63{5:-- VISUAL BLOCK --} | 64]] ) 65 66feed ( '<Esc>1234' ) 67screen : expect ( [[ 68{2:1234 }| 69a | 70b | 71^c | 72{1:~ }|*2 73| 74]] ) 75 76feed ( '<Esc>:set tabline=<CR>' ) 77feed ( ':<CR>' ) 78feed ( '1234' ) 79screen : expect ( [[ 80{5: + [No Name] }{2: }{24:1234}{2: }| 81a | 82b | 83^c | 84{1:~ }|*2 85: | 86]] ) 87end ) 88 89-- oldtest: Test_tabline_showcmd_redraw_tabline() 90it ( 'clears showcmd rendered by tabline redraw' , function () 91exec ( [[ 92set showcmd showcmdloc=tabline showtabline=2 tabline=%S timeoutlen=0 93nnoremap g :redraw<CR> 94nnoremap gc <Nop> 95]] ) 96feed ( 'g' ) 97screen : expect ( { any =':redraw' , none ='{2::' } ) 98t . eq ( '' , n . api . nvim_eval_statusline ( '%S' , {} ). str ) 99end ) 100end )