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

Re: support for the bang in :diffthis (was Re: [PATCH] :diffoff should not change settings for non-diff windows)

Expand Messages
  • Markus Heidelberg
    ... help, quickfix and preview are handled now. At the bottom of :h windows there are furthermore directory, scratch and unlisted. I m not quite sure how to
    Message 1 of 13 , Mar 6, 2009
    • 0 Attachment
      Ben Fritz, 06.03.2009:
      >
      > On Mar 6, 3:41 am, Markus Heidelberg <markus.heidelb...@...> wrote:
      > >
      > > What do you think, should the :diffthis! command set a special window
      > > into diffmode, if it is the current window or should it never adjust
      > > special windows?
      >
      > I think, if a user executes :diffthis! in a special window, they
      > probably intend to diff the special window.
      >
      > If they execute :diffthis! in a different window, and a special window
      > is also up, they may have forgotten the fact that the special window
      > is there.
      >
      > I would lean toward setting diff mode on the current window always,
      > but only setting it on other windows if they are not special.

      help, quickfix and preview are handled now. At the bottom of ":h
      windows" there are furthermore directory, scratch and unlisted. I'm not
      quite sure how to handle them. I think 'unlisted' doesn't have to be
      handled. I have heard about 'scratch' but I can't remember for what to
      use it. For 'directory' I get buftype=nofile when doing ":new .",
      "nowrite" in the documentation doesn't seem to be completely correct.

      Is it sufficient to simply treat each buftype!="" as special? But then
      'buftype' only exists for +quickfix, but I guess netrw.vim also works
      without this feature.

      > The command window should never be in diff mode however.

      The command window is restricted in possible commands anyway. And you
      cannot escape.

      Markus


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Bram Moolenaar
      ... Yes, if you do :diffthis or :diffthis! then the current window should always go to diff mode. But :diffthis! should only include other windows that are
      Message 2 of 13 , Mar 8, 2009
      • 0 Attachment
        Markus Heidelberg wrote:

        > Bram Moolenaar, 06.03.2009:
        > >
        > > Markus Heidelberg wrote:
        > >
        > > > Lech Lorens, 05.03.2009:
        > > > > Perfectly fine with me - I hardly ever use :diffoff without !, anyway.
        > > >
        > > > Is there a reason to not support the corresponding :diffthis! command?
        > > > For consistency it seems like a good idea, instead of using two
        > > > different ways ":windo diffthis" and ":diffoff!". Furthermore :windo can
        > > > move the cursor into another window, which is normally not desired.
        > > >
        > > > --- >8 ---
        > > >
        > > > Add support for :diffthis! for setting the diffmode in all windows in
        > > > the current tab page.
        > >
        > > Makes sense. But it should skip "special" windows: help, quickfix,
        > > preview, etc.
        >
        > Sure, will do.
        >
        > What do you think, should the :diffthis! command set a special window
        > into diffmode, if it is the current window or should it never adjust
        > special windows?
        > I guess the former solution would be more consistent, since :diffthis
        > sets the current window into diffmode regardless of it being a special
        > window or not.

        Yes, if you do :diffthis or :diffthis! then the current window should
        always go to diff mode. But ":diffthis!" should only include other
        windows that are "normal" to avoid trouble.

        It's perhaps a bit strange to use ":diffthis!" to start diff mode in
        other windows. ":diffall" would be more obvious. It's not symmetric
        with ":diffoff" vs ":diffoff!", but that one doesn't say "this".

        What do you all think about using ":diffall" instead?

        --
        The CIA drives around in cars with the "Intel inside" logo.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Markus Heidelberg
        ... That s for sure! ... Or what about :diffon[!] ? ... symmetry with :diffoff[!] in terms of invocation and spelling. Maybe this could be declared as the
        Message 3 of 13 , Mar 8, 2009
        • 0 Attachment
          Bram Moolenaar, 08.03.2009:
          >
          > Markus Heidelberg wrote:
          >
          > > Bram Moolenaar, 06.03.2009:
          > > >
          > > > Markus Heidelberg wrote:
          > > >
          > > > > Lech Lorens, 05.03.2009:
          > > > > > Perfectly fine with me - I hardly ever use :diffoff without !, anyway.
          > > > >
          > > > > Is there a reason to not support the corresponding :diffthis! command?
          > > > > For consistency it seems like a good idea, instead of using two
          > > > > different ways ":windo diffthis" and ":diffoff!". Furthermore :windo can
          > > > > move the cursor into another window, which is normally not desired.
          > > > >
          > > > > --- >8 ---
          > > > >
          > > > > Add support for :diffthis! for setting the diffmode in all windows in
          > > > > the current tab page.
          > > >
          > > > Makes sense. But it should skip "special" windows: help, quickfix,
          > > > preview, etc.
          > >
          > > Sure, will do.
          > >
          > > What do you think, should the :diffthis! command set a special window
          > > into diffmode, if it is the current window or should it never adjust
          > > special windows?
          > > I guess the former solution would be more consistent, since :diffthis
          > > sets the current window into diffmode regardless of it being a special
          > > window or not.
          >
          > Yes, if you do :diffthis or :diffthis! then the current window should
          > always go to diff mode. But ":diffthis!" should only include other
          > windows that are "normal" to avoid trouble.
          >
          > It's perhaps a bit strange to use ":diffthis!" to start diff mode in
          > other windows.

          That's for sure!

          > ":diffall" would be more obvious. It's not symmetric
          > with ":diffoff" vs ":diffoff!", but that one doesn't say "this".
          >
          > What do you all think about using ":diffall" instead?

          Or what about :diffon[!] ?
          :diffon would be a synonym for :diffthis then and there would be
          symmetry with :diffoff[!] in terms of invocation and spelling.
          Maybe this could be declared as the preferred method then.

          Indeed I already wondered, why it was called :diffthis instead of
          :diffon, since there was a :diffoff. And then I read that :diffoff was
          introduced a major version later than :diffthis. I guess if they were
          introduced at the same time, it wouldn't have been called :diffthis.

          Markus


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Andy Wokula
          ... I d prefer :diffall over :diffon! : When there are three commands for diffing, it will be clearer what :diffall means. Later :diffall! can be added
          Message 4 of 13 , Mar 8, 2009
          • 0 Attachment
            Markus Heidelberg schrieb:
            > Bram Moolenaar, 08.03.2009:
            >> Markus Heidelberg wrote:
            >>
            >>> Bram Moolenaar, 06.03.2009:
            >>>> Markus Heidelberg wrote:
            >>>>
            >>>>> Lech Lorens, 05.03.2009:
            >>>>>> Perfectly fine with me - I hardly ever use :diffoff without !, anyway.
            >>>>> Is there a reason to not support the corresponding :diffthis! command?
            >>>>> For consistency it seems like a good idea, instead of using two
            >>>>> different ways ":windo diffthis" and ":diffoff!". Furthermore :windo can
            >>>>> move the cursor into another window, which is normally not desired.
            >>>>>
            >>>>> --- >8 ---
            >>>>>
            >>>>> Add support for :diffthis! for setting the diffmode in all windows in
            >>>>> the current tab page.
            >>>> Makes sense. But it should skip "special" windows: help, quickfix,
            >>>> preview, etc.
            >>> Sure, will do.
            >>>
            >>> What do you think, should the :diffthis! command set a special window
            >>> into diffmode, if it is the current window or should it never adjust
            >>> special windows?
            >>> I guess the former solution would be more consistent, since :diffthis
            >>> sets the current window into diffmode regardless of it being a special
            >>> window or not.
            >>>
            >> Yes, if you do :diffthis or :diffthis! then the current window should
            >> always go to diff mode. But ":diffthis!" should only include other
            >> windows that are "normal" to avoid trouble.
            >>
            >> It's perhaps a bit strange to use ":diffthis!" to start diff mode in
            >> other windows.
            >
            > That's for sure!
            >
            >> ":diffall" would be more obvious. It's not symmetric
            >> with ":diffoff" vs ":diffoff!", but that one doesn't say "this".
            >>
            >> What do you all think about using ":diffall" instead?
            >
            > Or what about :diffon[!] ?
            > :diffon would be a synonym for :diffthis then and there would be
            > symmetry with :diffoff[!] in terms of invocation and spelling.
            > Maybe this could be declared as the preferred method then.
            >
            > Indeed I already wondered, why it was called :diffthis instead of
            > :diffon, since there was a :diffoff. And then I read that :diffoff was
            > introduced a major version later than :diffthis. I guess if they were
            > introduced at the same time, it wouldn't have been called :diffthis.
            >
            > Markus

            I'd prefer ":diffall" over ":diffon!":

            When there are three commands for diffing, it will be clearer what
            ":diffall" means.

            Later ":diffall!" can be added to really include all windows in the
            diff.

            ":diffon!" and ":diffoff!" wouldn't be exact opposites: if other windows
            are special, ":diffoff!" may include them, unlike ":diffon!".

            --
            Andy


            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • John Beckett
            ... There is already quite a bit of history in Vim, so I would prefer to NOT introduce a new command. The following looks logical to me: Go to window 1 ...
            Message 5 of 13 , Mar 8, 2009
            • 0 Attachment
              Bram Moolenaar wrote:
              > It's perhaps a bit strange to use ":diffthis!" to start diff
              > mode in other windows. ":diffall" would be more obvious.
              > It's not symmetric with ":diffoff" vs ":diffoff!", but that
              > one doesn't say "this".
              >
              > What do you all think about using ":diffall" instead?

              There is already quite a bit of "history" in Vim, so I would prefer to
              NOT introduce a new command. The following looks logical to me:

              " Go to window 1
              :diffthis
              " Go to window 2
              :diffthis

              " Remove diff from all visible windows
              :diffoff!

              " Apply diff to all visible (normal) windows
              :diffthis!

              John


              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Markus Heidelberg
              ... If :diffthis wouldn t yet exist, I d definetly prefer :diffon[!] and ... is probably a bit confusing, since we would end up with 3 commands (this|off|all)
              Message 6 of 13 , Mar 13, 2009
              • 0 Attachment
                John Beckett, 09.03.2009:
                >
                > Bram Moolenaar wrote:
                > > It's perhaps a bit strange to use ":diffthis!" to start diff
                > > mode in other windows. ":diffall" would be more obvious.
                > > It's not symmetric with ":diffoff" vs ":diffoff!", but that
                > > one doesn't say "this".
                > >
                > > What do you all think about using ":diffall" instead?
                >
                > There is already quite a bit of "history" in Vim, so I would prefer to
                > NOT introduce a new command.

                If :diffthis wouldn't yet exist, I'd definetly prefer :diffon[!] and
                :diffoff[!]. But now I also prefer :diffthis!. A new command :diffall
                is probably a bit confusing, since we would end up with 3 commands
                (this|off|all) for 2 (or 4) actions (diff on/off).

                I just though, if we treat :diffthis as "diff this window" and
                :diffthis! as "diff this tab", then the "this" in the latter command
                doesn't seem so linguistic strange any more.

                > The following looks logical to me:
                >
                > " Go to window 1
                > :diffthis
                > " Go to window 2
                > :diffthis
                >
                > " Remove diff from all visible windows
                > :diffoff!
                >
                > " Apply diff to all visible (normal) windows
                > :diffthis!

                This is my preferred solution, too.

                Markus


                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_dev" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              Your message has been successfully submitted and would be delivered to recipients shortly.