On Wed, Jan 9, 2013 at 12:59 AM, Bram Moolenaar <[email protected]> wrote:
>
> Boris Danilov wrote:
>
>> The question is how to call a function on a ftplugin undo? As far as I
>> understand, the universal method for undoing stuff is putting commands
>> to b:undo_ftplugin, but  I can't put either "s:Fun" or "<SID>Fun"
>> there.
>>
>> "s:Fun" doesn't work because b:undo_ftplugin is executed in the other
>> script file and "<SID>Fun" doesn't work because <SID> isn't expanded
>> in strings but expanded in the other place where b:undo_ftplugin is
>> being executed with :execute. Is there a function that will expand
>> <SID> immediatelly and convert it to a string?
>>
>> Of course there is always a way to use :autocmd FileType to handle it
>> manually, but then it makes me wonder why there is a mechanism of
>> b:undo_ftplugin if I have to do it on my own.
>>
>> What I am missing there?
>
> Right, since this is done with Vim scripts the script-local functions
> cannot be easily called.  Would be useful though.
> For the time being you could use a global function with a unique name.
>

That's a good idea I didn't think about. It was great if
expand("<SID>") could expand to "<SNR>NN_" in this case.

Regards,
Boris

-- 
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

Reply via email to