Vim and Ruby script : object callback possible ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Vim and Ruby script : object callback possible ?

Ni Va
Hi all,

From Vim ruby help, there is this example  :

Example Vim script: >

        function! RedGem()
        ruby << EOF
        class Garnet
                def initialize(s)
                        @buffer = Vim::Buffer.current
                        vimputs(s)
                end
                def vimputs(s)
                        @buffer.append(@buffer.count,s)
                end
        end
        gem = Garnet.new("pretty")
        EOF
        endfunction


Calling by this commannd
command! -nargs=0 FOO    call RedGem()


From first call by FOO cmd that make instance from new ruby Object Garnet,the instance is it still alive in order to call another gem.barmethod?

How to keep ruby objects alive in Vim buffer memory in order to reuse them ?

Thank you
Ni Va

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.