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

todo? (setting eol/noeol after :r !cmd ? )

Expand Messages
  • Yakov Lerner
    Hello Bram, Maybe vim would better set &eol/&noel after :r !cmd also, no only after reading the file into buffer ? (that is, the condition whether input had
    Message 1 of 3 , Feb 28, 2007
    • 0 Attachment
      Hello Bram,

      Maybe vim would better set &eol/&noel after ':r !cmd' also,
      no only after reading the file into buffer ? (that is, the condition
      whether input had final \n or not).
      As I can see currently, this piece of info is lost after ': !cmd' ?

      Yakov
    • A.J.Mechelynck
      ... Maybe after :$r !cmd (appending at end-of-file), but not in other cases since the last line of the file isn t touched. Best regards, Tony. -- Hard work may
      Message 2 of 3 , Feb 28, 2007
      • 0 Attachment
        Yakov Lerner wrote:
        > Hello Bram,
        >
        > Maybe vim would better set &eol/&noel after ':r !cmd' also,
        > no only after reading the file into buffer ? (that is, the condition
        > whether input had final \n or not).
        > As I can see currently, this piece of info is lost after ': !cmd' ?
        >
        > Yakov
        >

        Maybe after :$r !cmd (appending at end-of-file), but not in other cases since
        the last line of the file isn't touched.

        Best regards,
        Tony.
        --
        Hard work may not kill you, but why take chances?
      • Bram Moolenaar
        ... It completely depends on what you are doing. If you have binary set and do :r !cmd on the last line, then you actually insert a line break already, no
        Message 3 of 3 , Feb 28, 2007
        • 0 Attachment
          Yakov Lerner wrote:

          > Maybe vim would better set &eol/&noel after ':r !cmd' also,
          > no only after reading the file into buffer ? (that is, the condition
          > whether input had final \n or not).
          > As I can see currently, this piece of info is lost after ': !cmd' ?

          It completely depends on what you are doing. If you have 'binary' set
          and do ":r !cmd" on the last line, then you actually insert a line break
          already, no matter if 'endofline' is set or not. And whether the value
          of 'endofline' should be adjusted to the output of "cmd" again depends
          on what you are doing. If you are concatenating binary files it does
          make sense to adjust 'endofline'. But you still need to fix that line
          break if 'endofline' wasn't set before.

          Perhaps it's a lot simpler if we just leave it to the user. It's a very
          uncommon issue anyway.

          --
          hundred-and-one symptoms of being an internet addict:
          229. You spend so much time thinking what to add on this list.

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ download, build and distribute -- http://www.A-A-P.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
        Your message has been successfully submitted and would be delivered to recipients shortly.