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

Re: ruby embedding and here documents

Expand Messages
  • Bram Moolenaar
    ... The problem is that the a
    Message 1 of 4 , Dec 29, 2002
      Emmanuel Touzery wrote:

      > In general i have no problems embedding ruby code in vim macros using
      > here documents, eg
      > function A()
      > ruby << EOF
      > # ruby code
      > EOF
      > endfunction
      >
      > however vim does not seem to support that then the ruby code itself uses here
      > documents..
      > eg try to source this:
      > ---------8<----------------
      > function! Test()
      > ruby << EOF
      > a << TT
      > TT
      > EOF
      > endfunction
      > ---------------------------------
      >
      > you will get a E126: Missing :endfunction. if you remove the inner a<<TT\nTT,
      > the problem disappears.

      The problem is that the "a << TT" is recognized as an ":append" command.
      Vim then searches for a line containing just a dot.

      There is no special case for handling the "ruby << EOF" command inside a
      function. I'll add a remark in the todo list that the lines until "EOF"
      are to be consumed.

      --
      hundred-and-one symptoms of being an internet addict:
      209. Your house stinks because you haven't cleaned it in a week.

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
      \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
      \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.