ruby << EOF in vimscript broken in Vim 7.1

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ruby << EOF in vimscript broken in Vim 7.1

Tim Pope-2
Hi all,

As the subject states, the following is broken in Vim script syntax
highlighting in 7.1.  This was overlooked because vim.vim always
sources the ruby.vim from the current directory, not the one from the
runtimepath.

ruby << EOF
  def foo
  end
EOF

Apparently, the use of TOP is taken to mean vim script, not ruby,
even though it is declared in vim script.  Most of this is inside the
"expensive" ruby block stuff.  Skipping this (ala eruby) might be a
cheap way to fix this problem.  Anyone have any other easy ideas?

I'll look at the more tomorrow; I just wanted to get it out there so
people can think about it.

Cheers,
Tim
_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ruby << EOF in vimscript broken in Vim 7.1

Doug Kearns
On 5/16/07, Tim Pope <[hidden email]> wrote:
> Hi all,
>
> As the subject states, the following is broken in Vim script syntax
> highlighting in 7.1.  This was overlooked because vim.vim always
> sources the ruby.vim from the current directory, not the one from the
> runtimepath.

Hmmm...doesn't seem like a good idea to me but this inclusion method
is quite common in the syntax files.  What am I missing?

> ruby << EOF
>   def foo
>   end
> EOF
>
> Apparently, the use of TOP is taken to mean vim script, not ruby,
> even though it is declared in vim script.  Most of this is inside the
> "expensive" ruby block stuff.  Skipping this (ala eruby) might be a
> cheap way to fix this problem.  Anyone have any other easy ideas?

Yeah, it sounds like a problem for Chip. :)

> I'll look at the more tomorrow; I just wanted to get it out there so
> people can think about it.

That would be great if you can - I won't be able to get to it until
next week.  Fortunately, you may be the only one currently in need of
a fix. ;-)

Regards,
Doug
_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ruby << EOF in vimscript broken in Vim 7.1

Tim Pope-2
On Thu, May 17, 2007 at 12:52:31AM +1000, Doug Kearns wrote:
> On 5/16/07, Tim Pope <[hidden email]> wrote:
> > I'll look at the more tomorrow; I just wanted to get it out there so
> > people can think about it.
>
> That would be great if you can - I won't be able to get to it until
> next week.  Fortunately, you may be the only one currently in need of
> a fix. ;-)

I was actually researching another problem when I discovered this.
All the rails specific omnicompletion (and probably, everything
involving buffer loading), has stopped working for me as of 7.1, even
with all applicable optios set and identical versions of
rubycomplete.vim.  Mark Guzman, can you shed any light on this?

I'm a bit short on time this week myself, as I am attending RailsConf
this weekend.  There's still plenty of time before Vim 7.2 though, and
I've already gotten started.

One thing I have discovered so far:  There are only 23 uses of
contains=TOP in all the syntax files shipped with vim.  Of those, 17
are in ruby.vim.  Apparently, this feature isn't used nearly as widely
as I would have expected.  The more common solution involves ALLBUT.
ALLBUT does work as you would hope when a syntax file is included,
also discluding groups from the contained file, whereas TOP dumbly
takes the TOP of the including file (if that makes sense at all).

I originally switched to using TOP because it seemed cleaner than
constantly updating the list of discluded groups.  I am switching to
using contains=ALLBUT,@rubyNotTop.  This appears to fix the issue.
Keep an eye out for groups I forgot to add to the rubyNotTop cluster.

After the dust settles (maybe give it a couple of weeks), I'd like to
see a bugfix release, if nobody minds.  Unfortunately, syntax/vim.vim
will still read the ruby.vim that ships with Vim unless users take an
additional step.  But, at least we will have made that much possible.

Cheers,
Tim
_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ruby << EOF in vimscript broken in Vim 7.1

Mark Guzman
Tim Pope wrote:
> I was actually researching another problem when I discovered this.
> All the rails specific omnicompletion (and probably, everything
> involving buffer loading), has stopped working for me as of 7.1, even
> with all applicable optios set and identical versions of
> rubycomplete.vim.  Mark Guzman, can you shed any light on this?

I'll look into it this weekend, I've been working on overhauling the
rubycomplete stuff anyway. Can you email me tarball of your vim config
and possibly point me at some example code where it breaks? My initial
testing under windows, linux and osx doesn't show any issue currently.
I'm testing with mephisto on all platforms and it's possible that
something that's getting loaded from the buffer is effecting the
completion stuff. The probability on that last one is pretty low, as
the current version doesn't load the actual code from the buffer, only
skeletal method/class definitions.
   --mark

_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ruby << EOF in vimscript broken in Vim 7.1

Mark Guzman
Mark Guzman wrote:
> Tim Pope wrote:
>> I was actually researching another problem when I discovered this.
>> All the rails specific omnicompletion (and probably, everything
>> involving buffer loading), has stopped working for me as of 7.1, even
>> with all applicable optios set and identical versions of
>> rubycomplete.vim.  Mark Guzman, can you shed any light on this?
Just to keep you updated, I've managed to trigger a bug. I don't know
if it's related but I am working on it currently. It seems to involve
trying to complete variables inside of a class definition while
editing a rails file.
  --mark


_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel
Loading...