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

undo doesn't fully undo -- won't restore original file.

Expand Messages
  • Linda A. Walsh
    I edited a file to test with an app that, oddly, didn t have an eol at the end of the last file line. My edit didn t work so I pressed u to undo and
    Message 1 of 3 , Jul 12, 2014
      I edited a file to test with an app that, oddly, didn't have an "eol" at the
      end of the last file line.

      My edit didn't work so I pressed "u" to undo and rewrote the original file.

      But now it wasn't. It had an extra character at the end of the file (which
      the app took as file corruption).

      How can I get vim not to force an "eol" onto a file that didn't
      originally have
      one?

      (Ideally, I'd like it to preserve state... not add them to files that
      don't have them
      and not delete them from those that do).

      How do I get Vim to restore the file to the original state?

      Thanks!

      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Christian Brabandt
      ... http://vim.wikia.com/wiki/Preserve_missing_end-of-line_at_end_of_text_files http://www.vim.org/scripts/script.php?script_id=4550 Best, Christian -- -- --
      Message 2 of 3 , Jul 12, 2014
        On Sa, 12 Jul 2014, Linda A. Walsh wrote:

        > I edited a file to test with an app that, oddly, didn't have an "eol" at the
        > end of the last file line.
        >
        > My edit didn't work so I pressed "u" to undo and rewrote the original file.
        >
        > But now it wasn't. It had an extra character at the end of the file (which
        > the app took as file corruption).
        >
        > How can I get vim not to force an "eol" onto a file that didn't
        > originally have one?
        >
        > (Ideally, I'd like it to preserve state... not add them to files
        > that don't have them and not delete them from those that do).

        :h 'binary'
        :h 'eol'

        http://vim.wikia.com/wiki/Preserve_missing_end-of-line_at_end_of_text_files
        http://www.vim.org/scripts/script.php?script_id=4550

        Best,
        Christian
        --

        --
        --
        You received this message from the "vim_use" 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_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • Linda A. Walsh
        ... Yeah, it seems I need one of the below workarounds as the eol option is disabled for text files. ... === Thanks! -- -- You received this message from the
        Message 3 of 3 , Jul 12, 2014
          Christian Brabandt wrote:
          > :h 'binary'
          > :h 'eol'
          >
          ----
          Yeah, it seems I need one of the below workarounds
          as the 'eol' option is disabled for text files.

          > http://vim.wikia.com/wiki/Preserve_missing_end-of-line_at_end_of_text_files
          > http://www.vim.org/scripts/script.php?script_id=4550
          >
          ===
          Thanks!


          --
          --
          You received this message from the "vim_use" 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_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        Your message has been successfully submitted and would be delivered to recipients shortly.