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()))
endand ran |
Beta Was this translation helpful? Give feedback.
It's not really duplication,
BufferandBufPaneare different. EveryBufPanehas aBufferinside it, but you may:Bufferin aBufPanethat is already open (for example by runningopen asd.txt), orBufPanewith aBufferthat is already open (for example by runninglogbecause 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: