Friday, March 28, 2014

Re: Suggestion for vim -diff behavior change

On 13:53 Fri 28 Mar , Josef Fortier wrote:
> I've only really actively used diff mode recently (as opposed to using it as a visual diff tool). The default folding update on a change has led me astray more then once.
>
> I've learned the workaround only today, zo and zc, but the auto-folding behavior seems to me to be a real UI issue. I believe that diff mode should:
>
> * leave the initial folding alone (it's quite useful)
> * leave the change markers in place (this is less important)
> * but **not** refold.
>
> In almost all diff resolution workflows I can imagine, we want to **review** the changes. Auto-folding assumes that we are omniscient and do not need to review.
>
> With the change marker keys, ]c , [c , folding is less important. I can navigate to a change set, so an ocean of text on the screen is less important. I suppose if there is a **massive** diffset (in which case vim-diff may not be the best choice) then the auto-folding behavior might be the correct behavior. But for almost all the scenarios I've been using diff-mode, the initial folding is as noise free as it needs to be.
>
> Keeping the change markers around also seems nice, as it facilitates review. Cycle through the changes with ]c and verify.
>
> Is there a way to change this behavior? Does it seem doable in vimscript?
>
> Anyways, it seems worth discussing. I'd like to hear any alternate views/approaches.
>

Hi,

You can easily open all folds with zr. If you want to have a wider
context you can:
set diffopt+=context:1000

and you should not see folding, though it is not the solution you ask
for since it removes the existing folding.

Best regards,
Marcin

No comments: