> Bee schrieb:
> > I use vim on Mac, Linux, Windows with versions 6 and 7.
>
> > :diffoff! works with version 7 but does not exist in version 6.
>
> > Currently I do this:
>
> > function! DiffOff()
> > if v:version < 700
> > windo set nodiff foldcolumn=0 noscrollbind nowrap scrollopt-=hor
> > else
> > diffoff!
> > endif
> > close
> > endf
>
> > Is there a way to specifically check for the existence of :diffoff! ?
>
> :echo exists(':diffoff')
>
> > And is this function sufficient?
>
> Additionally check if the window is really in diff mode:
>
> function! DiffOff()
> if exists(':diffoff') == 2
> windo if &diff | set nodiff foldcolumn=0 noscrollbind nowrap scrollopt-=hor | endif
> else
> diffoff!
> endif
> close
> endf
Thank you Jürgen
I think it better to place the test for &diff first:
function! DiffOff()
if &diff
if exists(':diffoff') == 2
windo set nodiff foldcolumn=0 noscrollbind nowrap scrollopt-
=hor
else
diffoff!
endif
close
endif
endf
--
You received this message from the "vim_use" 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
No comments:
Post a Comment