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

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

Expand Messages
  • Lech Lorens
    Apr 3 3:22 AM
      On 02-Apr-2013 Ben Fritz <fritzophrenic@...> wrote:
      > On Monday, April 1, 2013 11:43:38 AM UTC-5, Bram Moolenaar wrote:
      > >
      > > 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.
      > >
      > It's quite frequent where I work. I even have an autocmd that reloads the file in DOS format if it detects mixed line endings. It sets "nomodified" but doesn't save, so if I don't make any further changes, the file on-disk remains unchanged.

      But it is a kind of a half-solution. When you modify a single line in
      the file and write it, you end up with a number of changed lines. How do
      you cope with that? In this case I can't simply check in the file
      – I have to undo the line endings modifications which is quite a tedious
      and annoying task.
      I'll be extremely happy to get a hint how I should go about this

      > The problem is that many other editors, including Visual Studio and
      > UltraEdit, may read in Unix file format correctly, but depending on
      > how they are configured, will insert Windows line endings on any *new*
      > lines. UltraEdit will even preserve line ending style of any
      > copy-pasted text. That *sounds* like a feature but in reality it is
      > incredibly annoying.

      I beg to differ. In my opinion the real problem is that Vim refuses to
      cooperate. The compilers can deal with it, ctags and cscope can deal
      with it, all other editors can deal with it[1]. Vim can't and now that I'm
      trying to make Vim more friendly, I hear Vim is fine and I should fix
      the files. Vim may be my favourite editor but – sorry – in this
      particular case it is inferior to everything out there.

      > Do I understand correctly, that I won't see the problem, because I already force-reload the file to remove the mixed line endings?

      Yes, you are not going to see any improvements since you are already
      handling this one problem.

      Lech Lorens

      [1] I checked GNU Emacs: I built a tags file and then added a few
      carriage returns at the ends of the lines. It still worked.

      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