Sunday, June 3, 2018

Vim and Ruby script : object callback possible ?

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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment