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

Bug in search?

Expand Messages
  • Yegappan Lakshmanan
    Hi all, ... That is a a a a a a test ... I am searching using the following pattern: / ( ) _s* 1 to locate all the words that are repeated twice
    Message 1 of 3 , Jul 2, 2002
      Hi all,

      I have the following text in a file:

      ------x------
      That is a a a

      a a a test
      ------x------

      I am searching using the following pattern:

      /\(\<\w\+\>\)\_s*\1

      to locate all the words that are repeated twice consecutively.
      If the search is repeated twice, then the cursor is positioned
      at the character 'a' in the beginning of the third line. I think,
      the cursor should be positioned at the second 'a' in the third
      line. You can set the 'hlsearch' option to visually see the
      problem. Am I missing something or is this a bug?

      - Yegappan


      __________________________________________________
      Do You Yahoo!?
      Sign up for SBC Yahoo! Dial - First Month Free
      http://sbc.yahoo.com
    • Bill McCarthy
      ... The problem here is that although Vim highlights the correct three matches, n finds the wrong third match. Perhaps I missed a posted explanation. Thanks,
      Message 2 of 3 , Jul 14, 2002
        On July 02, 2002 2:25 PM, Yegappan Lakshmanan wrote:

        >I have the following text in a file:
        >
        >------x------
        >That is a a a
        >
        >a a a test
        >------x------
        >
        >I am searching using the following pattern:
        >
        >/\(\<\w\+\>\)\_s*\1

        The problem here is that although Vim highlights the correct
        three matches, 'n' finds the wrong third match.

        Perhaps I missed a posted explanation.

        Thanks,

        Bill
      • Yegappan Lakshmanan
        ... I got the following reply from Bram. - Yegappan ... __________________________________________________ Do You Yahoo!? Yahoo! Autos - Get free new car price
        Message 3 of 3 , Jul 14, 2002
          --- Bill McCarthy <WJMc@...> wrote:
          > On July 02, 2002 2:25 PM, Yegappan Lakshmanan wrote:
          >
          > >I have the following text in a file:
          > >
          > >------x------
          > >That is a a a
          > >
          > >a a a test
          > >------x------
          > >
          > >I am searching using the following pattern:
          > >
          > >/\(\<\w\+\>\)\_s*\1
          >
          > The problem here is that although Vim highlights the correct
          > three matches, 'n' finds the wrong third match.
          >
          > Perhaps I missed a posted explanation.
          >

          I got the following reply from Bram.

          - Yegappan

          >> I did see this message. It's mostly because of the 'c' flag in
          >> 'cpoptions'. The rules are a bit confusing, it's hard to decide what is
          >> right. I'll have a look if this can be made to work more like you
          >> expect.

          >> 'hlsearch' doesn't always work right for patterns that cross lines.


          __________________________________________________
          Do You Yahoo!?
          Yahoo! Autos - Get free new car price quotes
          http://autos.yahoo.com
        Your message has been successfully submitted and would be delivered to recipients shortly.