robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1-- vim: set foldmethod=marker foldmarker=[[,]] : 2-- Test for visual block shift and tab characters. 3 4local n =require ( 'test.functional.testnvim' )() 5local t =require ( 'test.testutil' ) 6 7local describe , it , setup =t . describe , t . it , t . setup 8local clear , feed , insert =n . clear , n . feed , n . insert 9local feed_command , expect =n . feed_command , n . expect 10 11describe ( 'visual block shift and tab characters' , function () 12setup ( clear ) 13 14it ( 'is working' , function () 15insert ( [[ 16one two three 17one two three 18one two three 19one two three 20one two three 21 22abcdefghijklmnopqrstuvwxyz 23abcdefghijklmnopqrstuvwxyz 24abcdefghijklmnopqrstuvwxyz 25abcdefghijklmnopqrstuvwxyz 26abcdefghijklmnopqrstuvwxyz]] ) 27 28feed ( 'gg' ) 29feed ( [[fe<C-v>4jR<esc>ugvr1:'<lt>,'>yank A<cr>]] ) 30feed_command ( '/^abcdefgh' ) 31feed ( '<C-v>4jI <esc>j<lt><lt>11|D' ) 32feed ( 'j7|a <esc>' ) 33feed ( 'j7|a <esc>' ) 34feed ( 'j7|a <esc>4k13|<C-v>4j<lt>' ) 35feed_command ( '$-5,$yank A' ) 36feed_command ( [[$-4,$s/\s\+//g]] ) 37feed ( '<C-v>4kI <esc>j<lt><lt>' ) 38feed ( 'j7|a <esc>' ) 39feed ( 'j7|a <esc>' ) 40feed ( 'j7|a <esc>4k13|<C-v>4j3<lt>' ) 41feed_command ( '$-4,$yank A' ) 42 43-- Put @a and clean empty lines 44feed_command ( '%d' ) 45feed_command ( '0put a' ) 46feed_command ( '$d' ) 47 48-- Assert buffer contents. 49expect ( [[ 50on1 two three 51on1 two three 52on1 two three 53on1 two three 54on1 two three 55 56abcdefghijklmnopqrstuvwxyz 57abcdefghij 58abc defghijklmnopqrstuvwxyz 59abc defghijklmnopqrstuvwxyz 60abc defghijklmnopqrstuvwxyz 61abcdefghijklmnopqrstuvwxyz 62abcdefghij 63abc defghijklmnopqrstuvwxyz 64abc defghijklmnopqrstuvwxyz 65abc defghijklmnopqrstuvwxyz]] ) 66end ) 67end )