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

Re: Multiple use of comma (,) or semicolon (;) after tT

Expand Messages
  • Bram Moolenaar
    ... This is how it worked before, and this is how Vi intended it to behave. Thus this certainly can t be called a bug. It might be inconvenient though. ...
    Message 1 of 4 , Sep 2, 2001
    • 0 Attachment
      David Kotchan wrote:

      > I brought this point up once before, but it didn't generate much interest.
      > But since we are trying to clean up Vim 6.0 for release as non-beta, I'd
      > like to bring it up again just to make sure.
      >
      > After using t to search for a character, using comma (,) multiple times to
      > search in the opposite direction does not do what you expect. After an
      > initial backwards search, it doesn't do anything, in fact. To make it
      > continue searching, you must use a count, eg. 2,
      >
      > Similarly: after using T to search for a character, using semicolon (;)
      > multiple times to search in the opposite direction doesn't do anything
      > after the initial forwards search. To make it do something, you must use a
      > count, eg. 2;

      This is how it worked before, and this is how Vi intended it to behave.
      Thus this certainly can't be called a bug. It might be inconvenient
      though.

      > I have a tiny 2-line patch to fix this behaviour, but at earlier the patch
      > was rejected because the current behaviour was compatible with how Vi does
      > it. I accept the argument, but now lately I read the following in the
      > "motion.txt" documentation:
      >
      > "The original Vi implementation of "e" is buggy. For example, the "e"
      > command will stop on the first character of a line if the previous line was
      > empty. But when you use "2e" this does not happen. In Vim "ee" and "2e"
      > are the same, which is more logical. However, this causes a small
      > incompatibility
      > between Vi and Vim."
      >
      > I submit the same argument applies here to comma (,) and semicolon
      > (;). Namely, ",," and "2," should be the same, and ";;" and "2;" should be
      > the same -- which is more logical ;-) But yes, it will cause a small
      > incompatibility between Vi and Vim, same as for "ee" and "2e".

      The Vi behavior of "ee" looks buggy. This is not as it was intended, since
      "e" never stops before a position.

      The problem with making ",," working the same as "2," is that some
      people may rely on "," not moving when it's just before the position
      searched for. I don't think someone would rely on "e" to get stuck
      in an empty line.

      If ",," is changed to behave like "2,", then "txtx" would also need to
      be changed to behave like "2tx", since it does the same thing. This
      doesn't sound like a good idea.

      --
      No letters of the alphabet were harmed in the creation of this message.

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
      \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
    • Thomas Köhler
      On Sat, Sep 01, 2001 at 06:04:37PM -0400, David Kotchan wrote: [...] ... I d vote for YAO :-) In fact, that ee thing as well as that
      Message 2 of 4 , Sep 2, 2001
      • 0 Attachment
        On Sat, Sep 01, 2001 at 06:04:37PM -0400,
        David Kotchan <dkotchan@...> wrote:
        [...]
        > After using t to search for a character, using comma (,) multiple times to
        > search in the opposite direction does not do what you expect. After an
        > initial backwards search, it doesn't do anything, in fact. To make it
        > continue searching, you must use a count, eg. 2,
        >
        > Similarly: after using T to search for a character, using semicolon (;)
        > multiple times to search in the opposite direction doesn't do anything
        > after the initial forwards search. To make it do something, you must use a
        > count, eg. 2;
        >
        > I have a tiny 2-line patch to fix this behaviour, but at earlier the patch
        > was rejected because the current behaviour was compatible with how Vi does
        > it. I accept the argument, but now lately I read the following in the
        > "motion.txt" documentation:
        >
        > "The original Vi implementation of "e" is buggy. For example, the "e"
        > command will stop on the first character of a line if the previous line was
        > empty. But when you use "2e" this does not happen. In Vim "ee" and "2e"
        > are the same, which is more logical. However, this causes a small
        > incompatibility
        > between Vi and Vim."
        >
        > I submit the same argument applies here to comma (,) and semicolon
        > (;). Namely, ",," and "2," should be the same, and ";;" and "2;" should be
        > the same -- which is more logical ;-) But yes, it will cause a small
        > incompatibility between Vi and Vim, same as for "ee" and "2e".
        >
        > I do not want to press this point, it does not matter to me personally -- I
        > patch all my Vims to make ",," the same as "2," so I myself am always
        > happy. But I actually use , and ; quite a bit so I thought others might
        > too, and that they might benefit from this proposal.
        >
        > I shall drop the matter for good if no one agrees with me.

        I'd vote for YAO :-)
        In fact, that 'ee' thing as well as that ';'-and-','-thing should be
        vi-compatible when 'cp' is set, but work in that "more logical" way
        when in 'nocp'-mode...

        Ciao,
        Thomas

        --
        Thomas Köhler Email: jean-luc@... | LCARS - Linux
        <>< WWW: http://jeanluc-picard.de | for Computers
        IRC: jeanluc | on All Real
        PGP public key available from Homepage! | Starships
      • Zdenek Sekera
        ... I agree with Thomas, it should work logically for nocp when *small nocompatibility* with vi shouldn t be an issue, maybe we could even go without YAO...
        Message 3 of 4 , Sep 3, 2001
        • 0 Attachment
          Thomas Köhler wrote:
          >
          > On Sat, Sep 01, 2001 at 06:04:37PM -0400,
          > David Kotchan <dkotchan@...> wrote:
          > [...]
          > > After using t to search for a character, using comma (,) multiple
          > times to
          > > search in the opposite direction does not do what you expect. After an
          >
          > > initial backwards search, it doesn't do anything, in fact. To make it
          > > continue searching, you must use a count, eg. 2,
          > >
          > > Similarly: after using T to search for a character, using semicolon
          > (;)
          > > multiple times to search in the opposite direction doesn't do anything
          >
          > > after the initial forwards search. To make it do something, you must
          > use a
          > > count, eg. 2;
          > >
          > > I have a tiny 2-line patch to fix this behaviour, but at earlier the
          > patch
          ...
          > >
          > > I shall drop the matter for good if no one agrees with me.
          >
          > I'd vote for YAO :-)
          > In fact, that 'ee' thing as well as that ';'-and-','-thing should be
          > vi-compatible when 'cp' is set, but work in that "more logical" way
          > when in 'nocp'-mode...

          I agree with Thomas, it should work 'logically' for nocp when
          *small nocompatibility* with vi shouldn't be an issue, maybe we could
          even go without YAO...

          In any case, maybe, David, you should post your patch so others could
          make their vim less compatible with vi :-)

          ---Zdenek
        Your message has been successfully submitted and would be delivered to recipients shortly.