Follow-up to #19841. %[FuncName] was documented for 'statusline', but didn't work in 'tabline'.
In statusline, winid alone usually tells the callback what was clicked. 'tabline' is different: it almost always hosts a dynamic list (tab pages, buffers, airline-style segments) routed through a single callback, with no per-item window to map back to — tabline callbacks receive winid == 0. Without a way to identify which entry was clicked, %[FuncName] is effectively unusable there. The %N[FuncName] syntax already exists for exactly this (N → a:info.minwid), but the tabline path never surfaced it.
This wires it up so tabline %[FuncName] clicks reach the callback, with a:info.winid == 0 so a shared callback can distinguish the context.
Reported by @chrisbra in #19841 (comment).
This pull request was implemented with the help of Claude.
https://github.com/vim/vim/pull/19950
(5 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Just realized while thinking about extending this to 'tabpanel': with the current design the callback can't tell whether a click came from 'statusline', 'tabline' (or future 'tabpanel'), because winid == 0 is the only signal and it would end up shared between tabline and tabpanel.
Would it make sense to add an "area" key to a:info ("statusline" / "tabline") now, so a shared dispatcher can branch cleanly? That keeps the door open for 'tabpanel' later without re-defining the meaning of winid == 0.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@mattn pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Added an "area" key to the callback info dict so the handler can tell where the click happened ("statusline" / "tabline") — see 9d5af3f.
I'm planning to add click handler support to 'tabpanel' in a follow-up PR after this one is merged; that path will pass "area": "tabpanel", so a shared dispatcher can branch cleanly without having to overload winid == 0.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
thanks. I agree the area key makes sense.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()