robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
fbcb7a056c
master
1local t =require ( 'test.testutil' ) 2local n =require ( 'test.functional.testnvim' )() 3 4local describe , it , before_each =t . describe , t . it , t . before_each 5local clear =n . clear 6local command =n . command 7local fn =n . fn 8local feed =n . feed 9local expect =n . expect 10local eq =t . eq 11local eval =n . eval 12 13before_each ( clear ) 14 15describe ( ':normal!' , function () 16it ( 'can get out of Insert mode if called from Ex mode #17924' , function () 17feed ( '1q:normal! Ifoo<CR>' ) 18feed ( 'visual<CR>' ) 19expect ( 'foo' ) 20end ) 21 22it ( 'does not execute command in Ex mode when running out of characters' , function () 23command ( 'let g:var = 0' ) 24command ( 'normal! 1q:let g:var = 1' ) 25eq ( 0 , eval ( 'g:var' )) 26end ) 27 28it ( '"1q:insert" does not hang #17980' , function () 29command ( 'normal! 1q:insert' ) 30expect ( '' ) 31end ) 32 33it ( 'can stop Visual mode without closing cmdwin vim-patch:9.0.0234' , function () 34feed ( 'q:' ) 35feed ( 'v' ) 36eq ( 'v' , fn . mode ( 1 )) 37eq ( ':' , fn . getcmdwintype ()) 38command ( 'normal! \027' ) 39eq ( 'n' , fn . mode ( 1 )) 40eq ( ':' , fn . getcmdwintype ()) 41end ) 42end )