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

RE: Multiple file search

Expand Messages
  • John Beckett
    ... I believe the above has a small error. The foldexpr compares: matchstr(FileForThisLine) =~ matchstr(FileForNextLine) However, =~ treats the rhs as a
    Message 1 of 9 , Oct 30, 2008
    • 0 Attachment
      Gary Johnson wrote:
      > Just exchanging the '<1' and the 1 at the end seems to fix it:
      >
      > setlocal
      > foldexpr=matchstr(getline(v:lnum),'^[^\|]\\+')=~matchstr(getli
      > ne(v:lnum+1),'^[^\|]\\+')?1:'<1'

      I believe the above has a small error. The foldexpr compares:
      matchstr(FileForThisLine) =~ matchstr(FileForNextLine)

      However, "=~" treats the rhs as a regex and I found some errors with things like
      searching in and below "..". I changed it to "==#" (equality, exact case).

      I originally put the new info in an inappropriate tip. Please see the updated tip in
      the "Folding output from vimgrep" section at:
      http://vim.wikia.com/wiki/Folding_of_gnu_make_output

      Yes - the title needs to be fixed. In the Comments section I'm asking for
      suggestions. Also, it would be great if a a couple of people would try the tip and
      let me know if it's ok.

      John


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