Perhaps a strange question so maybe a small explanation
of "why" is in order:

When I :source or :runtime a *.vim file, commands in that
file build a buffer. To know when the buffer is complete,
I have to know what follows, and if complete (because
the following has an indicator of the start of a new buffer)
add it to a vim variable g:xxx and start a new buffer.
In essence I have to always "know ahead".

Clearly the last buffer will not be ever complete because
there is nothing to tell me it should be completed. There
is nothing read from *.vim, since the :source ran to its end.
I can handle that last buffer only when I start using
the g:xxx variable and find out the buffer is not empty
and then add it to g:xxx.

That complicates the algorithm quite a bit so I was thinking
"is there a way to know :source or :runtime has finished"?
I was thinking of some autocmd, but unfortunately the only
event of interest in this context I found is 'SourcePre' but
no 'SourceAfter' which would ideal.

Would anyone have an idea how to recognize the end of
:source/:runtime?

Thanks,

---Zdenek 

Reply via email to