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

68922Re: [patch] Handle files with mixed LF - CRLF line endings when doing tag search

Expand Messages
  • Bram Moolenaar
    Apr 1 9:43 AM
    • 0 Attachment
      Lech Lorens wrote:

      > People using ctags while working on code which is edited by multiple
      > people in various editors will be familiar with this situation: the code
      > ends up with a mix of line endings – some of them are Unix-style, some
      > of them are DOS-style.
      > The problem is that if Vim reads such a file with ff=unix, it will fail
      > to find tags if the tag pattern searched should match on a DOS-style
      > line. The attached patch handles the problem in a naïve but surprisingly
      > effective way: if a pattern search fails, Vim will try putting "\r\*"
      > before the last "$" in the pattern and will retry the search.

      I wonder how many users actually run into files where only some lines
      end in a CR. I would consider such a file broken, and first thing would
      be to strip them all off.

      I suppose you can't do this because others don't see the problem and
      object to have such a change in version control?

      Although the solution would work, I hesitate including this in Vim.
      It's a small audience, and when the pattern indeed can't be found it
      takes twice as long to fail.

      How about this alternative: Filter your tags file to change the patterns
      to include an optional CR before the $: \r\=$

      hundred-and-one symptoms of being an internet addict:
      106. When told to "go to your room" you inform your parents that you
      can't...because you were kicked out and banned.

      /// 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 16 messages in this topic