Edit Page
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 20: | Line 20: | ||
<pre> |
<pre> |
||
− | command! -nargs=* -complete=file New call Foreach( "new %% ", |
+ | command! -nargs=* -complete=file New call Foreach( "new %% ", <f-args> ) |
− | command! -nargs=* -complete=file Vnew call Foreach( "vnew %% ", |
+ | command! -nargs=* -complete=file Vnew call Foreach( "vnew %% ", <f-args> ) |
− | command! -nargs=* -complete=file Diff call Foreach( "vnew %% | diffthis", |
+ | command! -nargs=* -complete=file Diff call Foreach( "vnew %% | diffthis", <f-args> ) |
" %% symbols are replaced with file/arg names |
" %% symbols are replaced with file/arg names |
||
function! Foreach( ... ) |
function! Foreach( ... ) |
||
Line 30: | Line 30: | ||
for i in range( 1, a:0 - 1 ) |
for i in range( 1, a:0 - 1 ) |
||
let l = split( glob( a:000[i] ), "\n" ) |
let l = split( glob( a:000[i] ), "\n" ) |
||
− | if len( l ) |
+ | if len( l ) < 1 |
let l = [ a:000[i] ] |
let l = [ a:000[i] ] |
||
endif |
endif |