robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1-- Normal mode tests. 2 3local t =require ( 'test.testutil' ) 4local n =require ( 'test.functional.testnvim' )() 5local Screen =require ( 'test.functional.ui.screen' ) 6 7local describe , it , before_each =t . describe , t . it , t . before_each 8local clear =n . clear 9local feed =n . feed 10local fn =n . fn 11local command =n . command 12local eq =t . eq 13local api =n . api 14 15describe ( 'Normal mode' , function () 16before_each ( clear ) 17 18it ( 'setting &winhighlight or &winblend does not change curswant #27470' , function () 19fn . setline ( 1 , { 'long long lone line' , 'short line' } ) 20feed ( 'ggfi' ) 21local pos =fn . getcurpos () 22feed ( 'j' ) 23command ( 'setlocal winblend=10 winhighlight=Visual:Search' ) 24feed ( 'k' ) 25eq ( pos , fn . getcurpos ()) 26end ) 27 28it ( '&showcmd does not crash with :startinsert #28419' , function () 29local screen =Screen . new ( 60 , 17 ) 30fn . jobstart ( { n . nvim_prog , '--clean' , '--cmd' , 'startinsert' } , { 31term =true , 32env ={ VIMRUNTIME =os . getenv ( 'VIMRUNTIME' ) } , 33} ) 34screen : expect ( { 35grid =[[ 36^ | 37~ |*13 38[No Name] 0,1 All| 39-- INSERT -- | 40| 41]] , 42attr_ids ={} , 43} ) 44end ) 45 46it ( 'replacing with ZWJ emoji sequences' , function () 47local screen =Screen . new ( 30 , 8 ) 48api . nvim_buf_set_lines ( 0 , 0 , - 1 , true , { 'abcdefg' } ) 49feed ( '05rπ§βπΎ' ) -- ZWJ 50screen : expect ( [[ 51π§βπΎπ§βπΎπ§βπΎπ§βπΎ^π§βπΎfg | 52{1:~ }|*6 53| 54]] ) 55 56feed ( '2rπ³οΈββ§οΈ' ) -- ZWJ and variant selectors 57screen : expect ( [[ 58π§βπΎπ§βπΎπ§βπΎπ§βπΎπ³οΈββ§οΈ^π³οΈββ§οΈg | 59{1:~ }|*6 60| 61]] ) 62end ) 63 64it ( '"gk" does not crash with signcolumn=yes in narrow window #31274' , function () 65feed ( 'o<Esc>' ) 66command ( '1vsplit | setlocal signcolumn=yes' ) 67feed ( 'gk' ) 68n . assert_alive () 69end ) 70end )