Hi Tony,
I know about source. That's why I've implemented this:
" FIXME: Is there a better way to execute multi line strings?
function! library#Exec(cmd)
let lines = split(a:cmd,"\n")
if (len(lines) > 1)
" is there a better way? (TODO! try to not use temp files!)
let file = tempname()
call writefile(lines, file)
exec 'source '.file
call delete(file)
elseif !empty(lines)
exec lines[0]
endif
endfunction
But that is ugly!
In my use case the script doesn't really exist on disk (or better to say
it does, but not as vimscript but serialized vim dictionary)
But suing Exec() You've no chance getting the s: or <sfile> context.
But its no longer urgent because I'm writing extra functions to add
mappings and autocommands. This way they will be removed when disabling
the pluign automatically..
Marc
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---