docs: improve 'tabline' click label docs (#27529)

This commit is contained in:
zeertzjq
2024-02-19 11:22:00 +08:00
committed by GitHub
parent fa131de9ad
commit a9f578b7a5
4 changed files with 29 additions and 25 deletions

View File

@@ -6078,16 +6078,17 @@ A jump table for the options with a short description can be found at |Q_op|.
) - End of item group. No width fields allowed. ) - End of item group. No width fields allowed.
T N For 'tabline': start of tab page N label. Use %T or %X to end T N For 'tabline': start of tab page N label. Use %T or %X to end
the label. Clicking this label with left mouse button switches the label. Clicking this label with left mouse button switches
to the specified tab page. to the specified tab page, while clicking it with middle mouse
button closes the specified tab page.
X N For 'tabline': start of close tab N label. Use %X or %T to end X N For 'tabline': start of close tab N label. Use %X or %T to end
the label, e.g.: %3Xclose%X. Use %999X for a "close current the label, e.g.: %3Xclose%X. Use %999X for a "close current
tab" label. Clicking this label with left mouse button closes tab" label. Clicking this label with left mouse button closes
specified tab page. the specified tab page.
@ N Start of execute function label. Use %X or %T to @ N Start of execute function label. Use %X or %T to end the label,
end the label, e.g.: %10@SwitchBuffer@foo.c%X. Clicking this e.g.: %10@SwitchBuffer@foo.c%X. Clicking this label runs the
label runs specified function: in the example when clicking once specified function: in the example when clicking once using left
using left mouse button on "foo.c" "SwitchBuffer(10, 1, 'l', mouse button on "foo.c", a `SwitchBuffer(10, 1, 'l', ' ')`
' ')" expression will be run. Function receives the expression will be run. The specified function receives the
following arguments in order: following arguments in order:
1. minwid field value or zero if no N was specified 1. minwid field value or zero if no N was specified
2. number of mouse clicks to detect multiple clicks 2. number of mouse clicks to detect multiple clicks

View File

@@ -327,7 +327,8 @@ Options:
'shortmess' "F" flag does not affect output from autocommands 'shortmess' "F" flag does not affect output from autocommands
'signcolumn' supports up to 9 dynamic/fixed columns 'signcolumn' supports up to 9 dynamic/fixed columns
'statuscolumn' full control of columns using 'statusline' format 'statuscolumn' full control of columns using 'statusline' format
'tabline' %@Func@foo%X can call any function on mouse-click 'tabline' middle-click on tabpage label closes tabpage,
and %@Func@foo%X can call any function on mouse-click
'termpastefilter' 'termpastefilter'
'ttimeout', 'ttimeoutlen' behavior was simplified 'ttimeout', 'ttimeoutlen' behavior was simplified
'winblend' pseudo-transparency in floating windows |api-floatwin| 'winblend' pseudo-transparency in floating windows |api-floatwin|

View File

@@ -6525,16 +6525,17 @@ vim.wo.stc = vim.wo.statuscolumn
--- ) - End of item group. No width fields allowed. --- ) - End of item group. No width fields allowed.
--- T N For 'tabline': start of tab page N label. Use %T or %X to end --- T N For 'tabline': start of tab page N label. Use %T or %X to end
--- the label. Clicking this label with left mouse button switches --- the label. Clicking this label with left mouse button switches
--- to the specified tab page. --- to the specified tab page, while clicking it with middle mouse
--- button closes the specified tab page.
--- X N For 'tabline': start of close tab N label. Use %X or %T to end --- X N For 'tabline': start of close tab N label. Use %X or %T to end
--- the label, e.g.: %3Xclose%X. Use %999X for a "close current --- the label, e.g.: %3Xclose%X. Use %999X for a "close current
--- tab" label. Clicking this label with left mouse button closes --- tab" label. Clicking this label with left mouse button closes
--- specified tab page. --- the specified tab page.
--- @ N Start of execute function label. Use %X or %T to --- @ N Start of execute function label. Use %X or %T to end the label,
--- end the label, e.g.: %10@SwitchBuffer@foo.c%X. Clicking this --- e.g.: %10@SwitchBuffer@foo.c%X. Clicking this label runs the
--- label runs specified function: in the example when clicking once --- specified function: in the example when clicking once using left
--- using left mouse button on "foo.c" "SwitchBuffer(10, 1, 'l', --- mouse button on "foo.c", a `SwitchBuffer(10, 1, 'l', ' ')`
--- ' ')" expression will be run. Function receives the --- expression will be run. The specified function receives the
--- following arguments in order: --- following arguments in order:
--- 1. minwid field value or zero if no N was specified --- 1. minwid field value or zero if no N was specified
--- 2. number of mouse clicks to detect multiple clicks --- 2. number of mouse clicks to detect multiple clicks

View File

@@ -8186,16 +8186,17 @@ return {
) - End of item group. No width fields allowed. ) - End of item group. No width fields allowed.
T N For 'tabline': start of tab page N label. Use %T or %X to end T N For 'tabline': start of tab page N label. Use %T or %X to end
the label. Clicking this label with left mouse button switches the label. Clicking this label with left mouse button switches
to the specified tab page. to the specified tab page, while clicking it with middle mouse
button closes the specified tab page.
X N For 'tabline': start of close tab N label. Use %X or %T to end X N For 'tabline': start of close tab N label. Use %X or %T to end
the label, e.g.: %3Xclose%X. Use %999X for a "close current the label, e.g.: %3Xclose%X. Use %999X for a "close current
tab" label. Clicking this label with left mouse button closes tab" label. Clicking this label with left mouse button closes
specified tab page. the specified tab page.
@ N Start of execute function label. Use %X or %T to @ N Start of execute function label. Use %X or %T to end the label,
end the label, e.g.: %10@SwitchBuffer@foo.c%X. Clicking this e.g.: %10@SwitchBuffer@foo.c%X. Clicking this label runs the
label runs specified function: in the example when clicking once specified function: in the example when clicking once using left
using left mouse button on "foo.c" "SwitchBuffer(10, 1, 'l', mouse button on "foo.c", a `SwitchBuffer(10, 1, 'l', ' ')`
' ')" expression will be run. Function receives the expression will be run. The specified function receives the
following arguments in order: following arguments in order:
1. minwid field value or zero if no N was specified 1. minwid field value or zero if no N was specified
2. number of mouse clicks to detect multiple clicks 2. number of mouse clicks to detect multiple clicks