Loading ...
Sorry, an error occurred while loading the content.

73292Re: [patch] diffoff! does not check &diff in current window

Expand Messages
  • Bram Moolenaar
    Sep 20, 2013
    • 0 Attachment
      Charles Cooper wrote:

      > On Thursday, September 19, 2013 3:45:24 PM UTC-4, Bram Moolenaar wrote:
      >
      > > I would say the current behavior is intended. If you reset 'diff', but
      > > then realize it doesn't look right, you can use :diffoff to reset the
      > > other side effects of :diffthis.
      >
      > I never thought of that!
      >
      > > If you don't want to change options, then why would you type :diffoff?
      >
      > For me, this appeared using diffoff! with a 3 window split: 2 windows
      > in a diff and 1 window not in the diff with related information.
      >
      > When issuing diffoff! from the non-diff window, the 2 diff windows
      > have their options reset as documented. The non-diff window also has
      > its options reset, which I did not expect. The options in that
      > non-diff window will always be set to vim defaults because options are
      > only saved for windows which are part of a diff.
      >
      > This situation does not occur often and can be worked around.

      OK, if you use diffoff! one would expect it to only apply to windows
      with 'diff' set. So the condition should be:

      if (eap->forceit ? wp->w_p_diff : wp == curwin)

      And make this clear in the documentation:

      :diffo[ff]! Switch off diff mode for the current window and in all windows
      in the current tab page where 'diff' is set. Resetting
      related options only happens in a window that has 'diff' set,
      if the current window does not have 'diff' set then no options
      in it are changed.
      --
      "Women marry men hoping they will change. Men marry women hoping
      they will not. So each is inevitably disappointed."
      - Einstein

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.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 vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Show all 4 messages in this topic