robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
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 api =n . api 9 10describe ( 'Vimscript syntax highlighting' , function () 11local screen --- @type test.functional.ui.screen 12 13before_each ( function () 14clear () 15n . add_builddir_to_rtp () 16exec ( [[ 17setfiletype vim 18syntax on 19]] ) 20screen =Screen . new () 21screen : set_default_attr_ids ( { 22[ 0 ] ={ foreground =Screen . colors . Blue , bold =true } , 23[ 1 ] ={ foreground =Screen . colors . Brown , bold =true } , 24[ 2 ] ={ foreground =tonumber ( '0x6a0dad' ) } , 25} ) 26end ) 27 28it ( 'prefixed boolean options are highlighted properly' , function () 29api . nvim_buf_set_lines ( 0 , 0 , - 1 , true , { 30'set number incsearch hlsearch' , 31'set nonumber noincsearch nohlsearch' , 32'set invnumber invincsearch invhlsearch' , 33} ) 34screen : expect ( [[ 35{1:^set} {2:number} {2:incsearch} {2:hlsearch} | 36{1:set} {2:nonumber} {2:noincsearch} {2:nohlsearch} | 37{1:set} {2:invnumber} {2:invincsearch} {2:invhlsearch} | 38{0:~ }|*10 39| 40]] ) 41end ) 42end )