@@ -2,13 +2,19 @@ Test for various eval features. vim: set ft=vim :
22
33Note: system clipboard is saved, changed and restored.
44
5+ clipboard contents
6+ something else
7+
58STARTTEST
69:so small.vim
710:set encoding = latin1
811:set noswapfile
912:lang C
1013:fun AppendRegContents (reg )
11- call append (' $' , printf (' %s: type %s; value: %s (%s), expr: %s (%s)' , a: reg , getregtype (a: reg ), getreg (a: reg ), string (getreg (a: reg , 0 , 1 )), getreg (a: reg , 1 ), string (getreg (a: reg , 1 , 1 ))))
14+ call AppendRegParts (a: reg , getregtype (a: reg ), getreg (a: reg ), string (getreg (a: reg , 0 , 1 )), getreg (a: reg , 1 ), string (getreg (a: reg , 1 , 1 )))
15+ :endfun
16+ :fun AppendRegParts (reg , type , cont, strcont, cont1, strcont1)
17+ call append (' $' , printf (' %s: type %s; value: %s (%s), expr: %s (%s)' , a: reg , a: type , a: cont , a: strcont , a: cont1 , a: strcont1 ))
1218endfun
1319:command -nargs =? AR :call AppendRegContents (<q-args> )
1420:fun SetReg (... )
@@ -122,18 +128,23 @@ call SetReg('/', ["abc/\n"])
122128call SetReg (' =' , [' "abc/"' ])
123129call SetReg (' =' , [" \" abc/\n \" " ])
124130$put = ' {{{1 System clipboard'
131+ if has (' clipboard' )
125132" Save and restore system clipboard.
126133" If no connection to X-Server is possible, test should succeed.
127- :let _clipreg = [' +' , getreg (' +' ), getregtype (' +' )]
128- :let _clipopt = &cb
129- :let &cb = ' unnamedplus'
130- :1 y
131- :AR +
132- :tabdo :windo :echo " hi"
133- :3 y
134- :AR +
135- :let &cb = _clipopt
136- :call call (' setreg' , _clipreg)
134+ let _clipreg = [' +' , getreg (' +' ), getregtype (' +' )]
135+ let _clipopt = &cb
136+ let &cb = ' unnamedplus'
137+ 5 y
138+ AR +
139+ tabdo :windo :echo " hi"
140+ 6 y
141+ AR +
142+ let &cb = _clipopt
143+ call call (' setreg' , _clipreg)
144+ else
145+ call AppendRegParts (' +' , ' V' , " clipboard contents\n " , " ['clipboard contents']" , " clipboard contents\n " , " ['clipboard contents']" )
146+ call AppendRegParts (' +' , ' V' , " something else\n " , " ['something else']" , " something else\n " , " ['something else']" )
147+ endif
137148$put = ' {{{1 Errors'
138149call ErrExe (' call setreg()' )
139150call ErrExe (' call setreg(1)' )
0 commit comments