difference between onBufferOpen
and onBufPaneOpen
?
#3573
-
I initially thought that the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's not really duplication,
To demonstrate this I added the following event handlers to my local micro = import("micro")
function onBufferOpen(buf)
micro.Log(string.format("opened Buffer (name='%s')", buf:GetName()))
end
function onBufPaneOpen(bp)
micro.Log(string.format("opened BufPane (id=%d) with Buffer (name='%s')", bp:ID(), bp.Buf:GetName()))
end and ran
|
Beta Was this translation helpful? Give feedback.
It's not really duplication,
Buffer
andBufPane
are different. EveryBufPane
has aBuffer
inside it, but you may:Buffer
in aBufPane
that is already open (for example by runningopen asd.txt
), orBufPane
with aBuffer
that is already open (for example by runninglog
because the log buffer is already opened at startup – not sure if there are other cases when this happens).To demonstrate this I added the following event handlers to my
~/.config/micro/init.lua
: