robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1local n =require ( 'test.functional.testnvim' )() 2local t =require ( 'test.testutil' ) 3 4local describe , it , before_each =t . describe , t . it , t . before_each 5local feed , insert , source =n . feed , n . insert , n . source 6local clear , feed_command , expect =n . clear , n . feed_command , n . expect 7 8describe ( 'marks' , function () 9before_each ( function () 10clear () 11end ) 12 13-- luacheck: ignore 621 (Indentation) 14it ( 'restores a deleted mark after delete-undo-redo-undo' , function () 15insert ( [[ 16 17textline A 18textline B 19textline C 20 21Results:]] ) 22 23feed_command ( [[:/^\t/+1]] ) 24feed ( [[maddu<C-R>u]] ) 25source ( [[ 26let g:a = string(getpos("'a")) 27$put ='Mark after delete-undo-redo-undo: '.g:a 28]] ) 29 30expect ( [=[ 31 32textline A 33textline B 34textline C 35 36Results: 37Mark after delete-undo-redo-undo: [0, 3, 2, 0]]=] ) 38end ) 39 40it ( "CTRL-A and CTRL-X updates last changed mark '[, ']" , function () 41insert ( [[ 42CTRL-A CTRL-X: 43123 123 123 44123 123 123 45123 123 123]] ) 46 47source ( [[ 48/^123/ 49execute "normal! \<C-A>`[v`]rAjwvjw\<C-X>`[v`]rX"]] ) 50 51expect ( [=[ 52CTRL-A CTRL-X: 53AAA 123 123 54123 XXXXXXX 55XXX 123 123]=] ) 56end ) 57end )