On Mar 18, 12:35 pm, Ben Fritz <[email protected]> wrote:
> On Mar 17, 9:11 pm, Steve Hall <[email protected]> wrote:
>
> > On Thu, 2011-03-17 at 14:33 -0700, Ben Fritz wrote:
>
> > > I know for quite some time, the diffexpr given in vimrc_example.vim
> > > (or wherever it is given in the default cream setup) is broken on
> > > Windows. Perhaps it still is broken?
>
> > First I've heard. Can we not start distributing .vimrc and _vimrc
> > instead of relying on the installer to create these?
>
> > Below is the _vimrc generated by the Cream installer, taken from Vim's
> > installer years ago. If someone can point out how it differs from the
> > current Vim default, I'll fix it.
>
> > --
> > Steve Hall [ digitect dancingpaper com ]
>
> > ---------------------------------------------------------------------
> > 1:set nocompatible
> > 2:source $VIMRUNTIME/vimrc_example.vim
> > 3:source $VIMRUNTIME/mswin.vim
> > 4:behave mswin
> > 5:
> > 6:set diffexpr=MyDiff()
> > 7:
> > 8:function MyDiff()
> > 9: let opt = '-a --binary '
> > 10: if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
> > 11: if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
> > 12: let arg1 = v:fname_in
> > 13: if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
> > 14: let arg2 = v:fname_new
> > 15: if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
> > 16: let arg3 = v:fname_out
> > 17: if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
> > 18: let eq = ''
> > 19: if $VIMRUNTIME =~ ' '
> > 20: if &sh =~ '\<cmd'
> > 21: let cmd = '"' . $VIMRUNTIME . '\diff"'
> > 22: let eq = '""'
> > 23: else
> > 24: let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
> > 25: endif
> > 26: else
> > 27: let cmd = $VIMRUNTIME . '\diff'
> > 28: endif
> > 29: silent execute '!'.cmd.' '.opt.arg1.' '.arg2.' > '.arg3.eq
> > 30:endfunction
> > ---------------------------------------------------------------------
>
> Wow, I thought I'd seen this on the list before. Maybe I was wrong.
> Details here:
>
> http://vim.wikia.com/wiki/Running_diff#Vim_distribution_from_Cream
>
> It looks like some changes have been made since the wiki article was
> written, I'm not sure if issues remain. It looks like at least the '!'
> placement has been fixed.
>
...but the backslash issues have not been fixed. Steve, the version
installed on my machine (I always choose to overwrite the _vimrc)
looks like this on line 20:
if &sh =~ '\<cmd'
let cmd = '\"' . $VIMRUNTIME . '\diff\"'
let eq = '\"\"'
If I get rid of the extra backslashes so it matches the version you
posted, it works fine. If the backslashes are left in, it breaks as
the OP describes.
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php