Skip to content

difference between onBufferOpen and onBufPaneOpen? #3573

Answered by Andriamanitra
matthias314 asked this question in Q&A
Discussion options

You must be logged in to vote

It's not really duplication, Buffer and BufPane are different. Every BufPane has a Buffer inside it, but you may:

  • open a new Buffer in a BufPane that is already open (for example by running open asd.txt), or
  • open a BufPane with a Buffer that is already open (for example by running log 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:

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=%…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by matthias314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants