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 command =n . command 8local exec =n . exec 9local feed =n . feed 10 11before_each ( clear ) 12 13describe ( "'cursorbind'" , function () 14-- oldtest: Test_cursorline_cursorbind_horizontal_scroll() 15it ( "behaves consistently whether 'cursorline' is set or not vim-patch:8.2.4795" , function () 16local screen =Screen . new ( 60 , 8 ) 17screen : set_default_attr_ids ( { 18[ 1 ] ={ bold =true , foreground =Screen . colors . Blue } , -- NonText 19[ 2 ] ={ bold =true , reverse =true } , -- StatusLine 20[ 3 ] ={ reverse =true } , -- StatusLineNC 21[ 4 ] ={ background =Screen . colors . Grey90 } , -- CursorLine, CursorColumn 22} ) 23exec ( [[ 24call setline(1, 'aa bb cc dd ee ff gg hh ii jj kk ll mm' .. 25\ ' nn oo pp qq rr ss tt uu vv ww xx yy zz') 26set nowrap 27" The following makes the cursor apparent on the screen dump 28set sidescroll=1 cursorcolumn 29" add empty lines, required for cursorcolumn 30call append(1, ['','','','']) 3120vsp 32windo :set cursorbind 33]] ) 34feed ( '20l' ) 35screen : expect ( [[ 36a bb cc dd ee ff gg │aa bb cc dd ee ff gg^ hh ii jj kk ll mm | 37{4: }│ {4: } |*4 38{1:~ }│{1:~ }| 39{3:[No Name] [+] }{2:[No Name] [+] }| 40| 41]] ) 42feed ( '10l' ) 43screen : expect ( [[ 44hh ii jj kk ll mm n│aa bb cc dd ee ff gg hh ii jj ^kk ll mm | 45{4: } │ {4: } |*4 46{1:~ }│{1:~ }| 47{3:[No Name] [+] }{2:[No Name] [+] }| 48| 49]] ) 50command ( 'windo :set cursorline' ) 51feed ( '0' ) 52feed ( '20l' ) 53screen : expect ( [[ 54{4:a bb cc dd ee ff gg }│{4:aa bb cc dd ee ff gg^ hh ii jj kk ll mm }| 55{4: }│ {4: } |*4 56{1:~ }│{1:~ }| 57{3:[No Name] [+] }{2:[No Name] [+] }| 58| 59]] ) 60feed ( '10l' ) 61screen : expect ( [[ 62{4: hh ii jj kk ll mm n}│{4:aa bb cc dd ee ff gg hh ii jj ^kk ll mm }| 63{4: } │ {4: } |*4 64{1:~ }│{1:~ }| 65{3:[No Name] [+] }{2:[No Name] [+] }| 66| 67]] ) 68command ( 'windo :set nocursorline nocursorcolumn' ) 69feed ( '0' ) 70feed ( '40l' ) 71screen : expect ( [[ 72kk ll mm nn oo pp qq│ bb cc dd ee ff gg hh ii jj kk ll mm n^n| 73│ |*4 74{1:~ }│{1:~ }| 75{3:[No Name] [+] }{2:[No Name] [+] }| 76| 77]] ) 78end ) 79end )