Add support for clickable regions in the statusline using %[FuncName] syntax. When a user clicks on a region, the specified Vim function is called with a dictionary argument. The function can return non-zero to trigger a statusline redraw.
%[FuncName] starts a clickable region, %[] ends it. If %[] is omitted, the region extends to the end of the statusline. %N[FuncName] passes an identifier N to the callback as minwid.
The callback receives a Dictionary with:
minwid: identifier from %N[Func] (0 if not specified)nclicks: number of clicks (1, 2, or 3)button: "l" (left), "m" (middle), "r" (right)mods: modifier keys, combination of "s" (shift), "c" (ctrl), "a" (alt)winid: window-ID of the clicked statuslineUse has('statusline_click') to check availability.
func! ClickFile(info) if a:info.button ==# 'l' && a:info.nclicks == 2 browse edit endif return 0 endfunc set statusline=%[ClickFile]%f%[]\ %l:%c
https://github.com/vim/vim/pull/19841
(16 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@mattn pushed 1 commit.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I plan to add clickable region support for tabpanel as well in a follow-up.
—
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.
You are receiving this because you are subscribed to this thread.![]()