P.S.
Okay, in documentation I found the following way to get the SID number:

function s:SID()
  return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
endfun

So that I can probably use something like
let b:undo_ftplugin = "call <SNR>" . s:SID . "_Func()"

Is there a simpler way without all these workarounds?

- Boris

On Mon, Jan 7, 2013 at 1:24 PM, Boris Danilov <[email protected]> wrote:
> Hello!
>
> 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?
>
> - 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