On 03-Jul-15, Bram Moolenaar wrote:
> 
> Olaf Dabrunz wrote:
> 
> > Just for the record, and to answer the question I asked in the thread:
> > I think that a repeatable :diffoff (as in this patch) makes more sense.
> > 
> > If :diffoff only worked once after diff mode was entered, it would not
> > destroy user settings.
> > 
> > But always returning diff settings back to safed "sane" settings (rather

... saved ... oh my...

> > than to one-size-fits-all defaults, when :diffoff is repeated) is
> > probably more useful.  Esp. because only settings are touched that look
> > like they are left over from diff mode.  So it is not too destructive.
> > 
> > This is a repeatable :diffoff that "carefully backs out of diff mode".
> 
> We'll have to see if a user comes up with a situation where the current
> behavior would be a problem.  Since the docs didn't need to be updated
> it's probably OK.

Yes.  Being careful does not mean that no-one has an issue.  Simpler,
less careful commands also tend to be easier to understand.

But it does not appear to break existing assumptions.  It also *feels*
ok(-ish).  And it may be simple enough.

We'll see...

Being able to describe the feel in one simple sentence, "it carefully
backs out of diff mode", gives me a good feeling about it.

It's probably more reassuring to say "it safely backs out of diff mode".

> By the way, if you can add a test for the new behavior (and what didn't
> change) that would be good.

Too... hot... can't... move...

Parks.  Trees.  Cooler. :)

I have attached a patch for test47.

Have an enjoyable summer evening!

-- 
Olaf Dabrunz (oda <at> fctrace.org)

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
Index: b/src/testdir/test47.in
===================================================================
--- a/src/testdir/test47.in	2015-02-07 19:03:10.016171353 +0100
+++ b/src/testdir/test47.in	2015-07-03 19:05:22.203018461 +0200
@@ -1,5 +1,7 @@
 Tests for vertical splits and filler lines in diff mode
 
+Also tests restoration of saved options by :diffoff.
+
 STARTTEST
 :so small.vim
 :" Disable the title to avoid xterm keeping the wrong one.
@@ -10,8 +12,15 @@ pkdd:w! Xtest
 ddGpkkrXoxxx:w! Xtest2
 :file Nop
 ggoyyyjjjozzzz
+:set foldmethod=marker foldcolumn=4
+:redir => nodiffsettings
+:silent! :set diff? fdm? fdc? scb? crb? wrap?
+:redir END
 :vert diffsplit Xtest
 :vert diffsplit Xtest2
+:redir => diffsettings
+:silent! :set diff? fdm? fdc? scb? crb? wrap?
+:redir END
 :" jump to second window for a moment to have filler line appear at start of
 :" first window
 ggpgg:let one = winline()
@@ -36,8 +45,30 @@ j:let three = three . "-" . winline()
 :call append("$", two)
 :call append("$", three)
 :$-2,$w! test.out
-:" Test that diffing shows correct filler lines
+:"
+:" Test diffoff
 :diffoff!
+:$put =nodiffsettings
+:$put =diffsettings
+1
+:redir => nd1
+:silent! :set diff? fdm? fdc? scb? crb? wrap?
+:redir END
+
+:redir => nd2
+:silent! :set diff? fdm? fdc? scb? crb? wrap?
+:redir END
+
+:redir => nd3
+:silent! :set diff? fdm? fdc? scb? crb? wrap?
+:redir END
+
+:$put =nd1
+:$put =nd2
+:$put =nd3
+:$-39,$w >> test.out
+:"
+:" Test that diffing shows correct filler lines
 :windo :bw!
 :enew
 :put =range(4,10)
@@ -51,7 +82,7 @@ j:let three = three . "-" . winline()
 :enew
 :put =w0
 :.w >> test.out
-:unlet! one two three w0
+:unlet! one two three nodiffsettings diffsettings nd1 nd2 nd3 w0
 :qa!
 ENDTEST
 
Index: b/src/testdir/test47.ok
===================================================================
--- a/src/testdir/test47.ok	2015-02-07 19:03:10.016171353 +0100
+++ b/src/testdir/test47.ok	2015-07-03 18:44:22.210929318 +0200
@@ -1,4 +1,44 @@
 2-4-5-6-8-9
 1-2-4-5-8
 2-3-4-5-6-7-8
+
+
+nodiff
+  foldmethod=marker
+  foldcolumn=4
+noscrollbind
+nocursorbind
+  wrap
+
+
+  diff
+  foldmethod=diff
+  foldcolumn=2
+  scrollbind
+  cursorbind
+nowrap
+
+
+nodiff
+  foldmethod=marker
+  foldcolumn=4
+noscrollbind
+nocursorbind
+  wrap
+
+
+nodiff
+  foldmethod=marker
+  foldcolumn=4
+noscrollbind
+nocursorbind
+  wrap
+
+
+nodiff
+  foldmethod=marker
+  foldcolumn=4
+noscrollbind
+nocursorbind
+  wrap
 1

Raspunde prin e-mail lui