[vim/vim] Support %[FuncName] click regions in 'tabline' (PR #19950)

3 views
Skip to first unread message

mattn

unread,
Apr 10, 2026, 9:38:00 PM (2 days ago) Apr 10
to vim/vim, Subscribed

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 (Na: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.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19950

Commit Summary

  • 0c16e5e Support %[FuncName] click regions in 'tabline'

File Changes

(5 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19950@github.com>

mattn

unread,
Apr 11, 2026, 8:34:17 AM (16 hours ago) Apr 11
to vim/vim, Subscribed
mattn left a comment (vim/vim#19950)

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.Message ID: <vim/vim/pull/19950/c4229428924@github.com>

mattn

unread,
Apr 11, 2026, 8:40:10 AM (16 hours ago) Apr 11
to vim/vim, Push

@mattn pushed 1 commit.

  • 9d5af3f Add 'area' key to %[FuncName] click info dict


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19950/before/0c16e5e17067ea28919a3659dcecdc3c98f085ce/after/9d5af3f4c5463d9d134426b402f0b8f424d9cb47@github.com>

mattn

unread,
Apr 11, 2026, 8:42:40 AM (16 hours ago) Apr 11
to vim/vim, Subscribed
mattn left a comment (vim/vim#19950)

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.Message ID: <vim/vim/pull/19950/c4229438987@github.com>

Christian Brabandt

unread,
Apr 11, 2026, 11:10:09 AM (14 hours ago) Apr 11
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19950)

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.Message ID: <vim/vim/pull/19950/c4229643543@github.com>

Christian Brabandt

unread,
Apr 11, 2026, 11:29:07 AM (13 hours ago) Apr 11
to vim/vim, Subscribed

Closed #19950 via 0802e00.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19950/issue_event/24409173550@github.com>

Reply all
Reply to author
Forward
0 new messages