Skip to content

Commit be5bd4d

Browse files
rbtnnthinca
authored andcommitted
patch 9.1.1391: Vim does not have a vertical tabpanel
Problem: Vim does not have a tabpanel Solution: include the tabpanel feature (Naruhiko Nishino, thinca) closes: #17263 Co-authored-by: thinca <[email protected]> Signed-off-by: Naruhiko Nishino <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 7200eae commit be5bd4d

File tree

100 files changed

+2314
-164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2314
-164
lines changed

Filelist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ SRC_ALL = \
151151
src/strings.c \
152152
src/structs.h \
153153
src/syntax.c \
154+
src/tabpanel.c \
154155
src/tag.c \
155156
src/term.c \
156157
src/terminal.c \
@@ -335,6 +336,7 @@ SRC_ALL = \
335336
src/proto/spellsuggest.pro \
336337
src/proto/strings.pro \
337338
src/proto/syntax.pro \
339+
src/proto/tabpanel.pro \
338340
src/proto/tag.pro \
339341
src/proto/term.pro \
340342
src/proto/terminal.pro \

runtime/doc/builtin.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim version 9.1. Last change: 2025 May 09
1+
*builtin.txt* For Vim version 9.1. Last change: 2025 May 14
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4730,6 +4730,8 @@ getmousepos() *getmousepos()*
47304730
If not over a window, e.g. when in the command line, then only
47314731
"screenrow" and "screencol" are valid, the others are zero.
47324732

4733+
When on the |tabpanel|, "wincol" value is zero.
4734+
47334735
When on the status line below a window or the vertical
47344736
separator right of a window, the "line" and "column" values
47354737
are zero.

runtime/doc/index.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*index.txt* For Vim version 9.1. Last change: 2025 Mar 18
1+
*index.txt* For Vim version 9.1. Last change: 2025 May 14
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1583,6 +1583,7 @@ tag command action ~
15831583
|:redraw| :redr[aw] force a redraw of the display
15841584
|:redrawstatus| :redraws[tatus] force a redraw of the status line(s)
15851585
|:redrawtabline| :redrawt[abline] force a redraw of the tabline
1586+
|:redrawtabpanel| :redrawtabp[anel] force a redraw of the tabpanel
15861587
|:registers| :reg[isters] display the contents of registers
15871588
|:resize| :res[ize] change current window height
15881589
|:retab| :ret[ab] change tab size

runtime/doc/options.txt

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim version 9.1. Last change: 2025 May 10
1+
*options.txt* For Vim version 9.1. Last change: 2025 May 14
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3657,11 +3657,12 @@ A jump table for the options with a short description can be found at |Q_op|.
36573657
trunc '>' truncated text in the
36583658
|ins-completion-menu|.
36593659
truncrl '<' same as "trunc" in 'rightleft' mode
3660+
tpl_vert '|' vertical separators of 'tabpanel'
36603661

36613662
Any one that is omitted will fall back to the default.
36623663

36633664
Example: >
3664-
:set fillchars=stl:\ ,stlnc:\ ,vert:\|,fold:-,diff:-
3665+
:set fillchars=stl:\ ,stlnc:\ ,vert:\|,fold:-,diff:-,tpl_vert:\|
36653666
<
36663667
All items support single-byte and multibyte characters. But
36673668
double-width characters are not supported. |E1512|
@@ -7689,6 +7690,20 @@ A jump table for the options with a short description can be found at |Q_op|.
76897690
line.
76907691
See |tab-page| for more information about tab pages.
76917692

7693+
*'showtabpanel'* *'stpl'*
7694+
'showtabpanel' 'stpl' number (default 0)
7695+
global
7696+
{not in Vi}
7697+
{not available when compiled without the |+tabpanel|
7698+
feature}
7699+
The value of this option specifies when the |tabpanel| with tab page
7700+
labels will be displayed:
7701+
0: never
7702+
1: only if there are at least two tab pages
7703+
2: always
7704+
This is for the non-GUI implementation of the tabpanel only.
7705+
See |tab-page| for more information about tab page labels.
7706+
76927707
*'sidescroll'* *'ss'*
76937708
'sidescroll' 'ss' number (default 0)
76947709
global
@@ -8408,6 +8423,71 @@ A jump table for the options with a short description can be found at |Q_op|.
84088423
Maximum number of tab pages to be opened by the |-p| command line
84098424
argument or the ":tab all" command. |tabpage|
84108425

8426+
*'tabpanel'* *'tpl'* *g:actual_curtabpage*
8427+
'tabpanel' 'tpl' string (default empty)
8428+
global
8429+
{not in Vi}
8430+
When non empty, this option determines the content of the |tabpanel|.
8431+
The option consists of printf style '%' items interspersed with
8432+
normal text, similar to the 'statusline' or 'tabline'.
8433+
8434+
When changing something that is used in 'tabpanel' that does not
8435+
trigger it to be updated, use |:redrawtabpanel|.
8436+
This option cannot be set in a modeline when 'modelineexpr' is off.
8437+
8438+
You can use |g:actual_curtabpage| within a function assigned to
8439+
tabpanel. |g:actual_curtabpage| represents current tab's label number.
8440+
This option can contain line breaks:
8441+
>
8442+
set tabpanel=%!TabPanel()
8443+
function! TabPanel() abort
8444+
return printf("(%2d)\n %%f", g:actual_curtabpage)
8445+
endfunction
8446+
<
8447+
The result is:
8448+
>
8449+
+-----------+---------------------------------
8450+
|(1) |
8451+
| ~/aaa.txt|
8452+
|(2) |
8453+
| ~/.vimrc |
8454+
| |
8455+
| |
8456+
| |
8457+
<
8458+
8459+
*'tabpanelopt'* *'tplo'*
8460+
'tabpanelopt' 'tplo' string (default "")
8461+
global
8462+
{not in Vi}
8463+
Optional settings for the |tabpanel|, It can consist of the following
8464+
items. Items must be separated by a comma.
8465+
8466+
align:{text} Specified the position of tabpanel.
8467+
Currently supported positions are:
8468+
8469+
left left-aligned
8470+
right right-aligned
8471+
8472+
(default "left")
8473+
8474+
columns:{n} Use the size (in char) of tabpanel.
8475+
The tabpanel is never shown when using zero
8476+
or less than the size of Vim window.
8477+
(default 20)
8478+
8479+
vert Use a vertical separator for tabpanel.
8480+
This vertical separator is used "tpl_vert" of
8481+
'fillchars'.
8482+
(default off)
8483+
8484+
Examples: >
8485+
:set tabpanelopt=columns:16,align:right
8486+
:set tabpanelopt=
8487+
:set tabpanelopt=vert,align:right
8488+
:set tabpanelopt=columns:16
8489+
<
8490+
84118491
*'tabstop'* *'ts'*
84128492
'tabstop' 'ts' number (default 8)
84138493
local to buffer

runtime/doc/syntax.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*syntax.txt* For Vim version 9.1. Last change: 2025 Apr 28
1+
*syntax.txt* For Vim version 9.1. Last change: 2025 May 10
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5991,6 +5991,12 @@ TabLine Tab pages line, not active tab page label.
59915991
TabLineFill Tab pages line, where there are no labels.
59925992
*hl-TabLineSel*
59935993
TabLineSel Tab pages line, active tab page label.
5994+
*hl-TabPanel*
5995+
TabPanel TabPanel, not active tab page label.
5996+
*hl-TabPanelFill*
5997+
TabPanelFill TabPanel, where there are no labels.
5998+
*hl-TabPanelSel*
5999+
TabPanelSel TabPanel, active tab page label.
59946000
*hl-Terminal*
59956001
Terminal |terminal| window (see |terminal-size-color|).
59966002
*hl-Title*

runtime/doc/tabpage.txt

Lines changed: 73 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*tabpage.txt* For Vim version 9.1. Last change: 2024 Jul 12
1+
*tabpage.txt* For Vim version 9.1. Last change: 2025 May 14
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -14,7 +14,8 @@ when used in combination with more than one tab page.
1414
2. Commands |tab-page-commands|
1515
3. Other items |tab-page-other|
1616
4. Setting 'tabline' |setting-tabline|
17-
5. Setting 'guitablabel' |setting-guitablabel|
17+
5. Setting 'tabpanel' |setting-tabpanel|
18+
6. Setting 'guitablabel' |setting-guitablabel|
1819

1920
{not able to use multiple tab pages when the |+windows| feature was disabled
2021
at compile time}
@@ -364,8 +365,8 @@ The 'tabline' option allows you to define your preferred way to tab pages
364365
labels. This isn't easy, thus an example will be given here.
365366

366367
For basics see the 'statusline' option. The same items can be used in the
367-
'tabline' option. Additionally, the |tabpagebuflist()|, |tabpagenr()| and
368-
|tabpagewinnr()| functions are useful.
368+
'tabline' and 'tabpanel' option. Additionally, the |tabpagebuflist()|,
369+
|tabpagenr()| and |tabpagewinnr()| functions are useful.
369370

370371
Since the number of tab labels will vary, you need to use an expression for
371372
the whole option. Something like: >
@@ -418,7 +419,74 @@ clever way when there is not enough room. Check the 'columns' option for the
418419
space available.
419420

420421
==============================================================================
421-
5. Setting 'guitablabel' *setting-guitablabel*
422+
5. Setting 'tabpanel' *tabpanel* *setting-tabpanel*
423+
424+
The tabpanel is a vertical sidebar that displays tab page labels along the
425+
side of the window. It looks like this:
426+
>
427+
+-----------+----------------------------------
428+
|(1) |text text text text text text text
429+
| ~/aaa.txt|text text text text text text text
430+
|(2) |text text text text text text text
431+
| ~/.vimrc |text text text text text text text
432+
|(3) |text text text text text text text
433+
| ~/bbb.js |text text text text text text text
434+
| ~/ccc.css|text text text text text text text
435+
| |text text text text text text text
436+
| |text text text text text text text
437+
| |text text text text text text text
438+
<
439+
To configure the tabpanel, use following options: 'tabpanel',
440+
'showtabpanel', 'tabpanelopt'.
441+
The 'tabpanel' and 'showtabpanel' options are function similar to the
442+
'statusline' or 'tabline'.
443+
444+
The "columns:" of 'tabpanelopt' option specifies the width of the tabpanel:
445+
>
446+
+------ This width
447+
|
448+
<----+----->
449+
+-----------+----------------------------------
450+
|(1) |text text text text text text text
451+
| ~/aaa.txt|text text text text text text text
452+
|(2) |text text text text text text text
453+
<
454+
The "align:" of 'tabpanelopt' option determines whether the tabpanel is
455+
displayed on the right side of the window:
456+
>
457+
+----------------------------------+-----------
458+
|text text text text text text text|(1)
459+
|text text text text text text text| ~/aaa.txt
460+
|text text text text text text text|(2)
461+
<
462+
The "wrap" of 'tabpanelopt' option controls whether lines in tabpanel are
463+
wraped:
464+
>
465+
+-----------+----------------------------------
466+
|(1) |text text text text text text text
467+
| ~/long_lo|text text text text text text text
468+
|ng_file_nam|text text text text text text text
469+
|e.txt |text text text text text text text
470+
|(2) |text text text text text text text
471+
472+
The "vert" of 'tabpanelopt' option defines whether a vertical separator is
473+
displayed between the tabpanel and the main window:
474+
>
475+
+------ This is
476+
|
477+
v
478+
+-----------+----------------------------------
479+
|(1) |text text text text text text text
480+
| ~/aaa.txt|text text text text text text text
481+
|(2) |text text text text text text text
482+
<
483+
The vertical separator is used "tpl_vert" of 'fillchars'.
484+
485+
You can customize the appearance of the tab page labels using the highlight
486+
groups: |hl-TabPanel| |hl-TabPanelSel| |hl-TabPanelFill|
487+
488+
==============================================================================
489+
6. Setting 'guitablabel' *setting-guitablabel*
422490

423491
When the GUI tab pages line is displayed, 'guitablabel' can be used to
424492
specify the label to display for each tab page. Unlike 'tabline', which

runtime/doc/tags

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,7 @@ $quote eval.txt /*$quote*
959959
'showmatch' options.txt /*'showmatch'*
960960
'showmode' options.txt /*'showmode'*
961961
'showtabline' options.txt /*'showtabline'*
962+
'showtabpanel' options.txt /*'showtabpanel'*
962963
'shq' options.txt /*'shq'*
963964
'si' options.txt /*'si'*
964965
'sidescroll' options.txt /*'sidescroll'*
@@ -1012,6 +1013,7 @@ $quote eval.txt /*$quote*
10121013
'statusline' options.txt /*'statusline'*
10131014
'stl' options.txt /*'stl'*
10141015
'stmp' options.txt /*'stmp'*
1016+
'stpl' options.txt /*'stpl'*
10151017
'sts' options.txt /*'sts'*
10161018
'su' options.txt /*'su'*
10171019
'sua' options.txt /*'sua'*
@@ -1183,6 +1185,8 @@ $quote eval.txt /*$quote*
11831185
'tabclose' options.txt /*'tabclose'*
11841186
'tabline' options.txt /*'tabline'*
11851187
'tabpagemax' options.txt /*'tabpagemax'*
1188+
'tabpanel' options.txt /*'tabpanel'*
1189+
'tabpanelopt' options.txt /*'tabpanelopt'*
11861190
'tabstop' options.txt /*'tabstop'*
11871191
'tag' options.txt /*'tag'*
11881192
'tagbsearch' options.txt /*'tagbsearch'*
@@ -1233,6 +1237,8 @@ $quote eval.txt /*$quote*
12331237
'toolbar' options.txt /*'toolbar'*
12341238
'toolbariconsize' options.txt /*'toolbariconsize'*
12351239
'top' options.txt /*'top'*
1240+
'tpl' options.txt /*'tpl'*
1241+
'tplo' options.txt /*'tplo'*
12361242
'tpm' options.txt /*'tpm'*
12371243
'tr' options.txt /*'tr'*
12381244
'ts' options.txt /*'ts'*
@@ -1478,6 +1484,7 @@ $quote eval.txt /*$quote*
14781484
+sun_workshop various.txt /*+sun_workshop*
14791485
+syntax various.txt /*+syntax*
14801486
+system() various.txt /*+system()*
1487+
+tabpanel various.txt /*+tabpanel*
14811488
+tag_any_white various.txt /*+tag_any_white*
14821489
+tag_binary various.txt /*+tag_binary*
14831490
+tag_old_static various.txt /*+tag_old_static*
@@ -3141,6 +3148,8 @@ $quote eval.txt /*$quote*
31413148
:redrawstatus various.txt /*:redrawstatus*
31423149
:redrawt various.txt /*:redrawt*
31433150
:redrawtabline various.txt /*:redrawtabline*
3151+
:redrawtabp various.txt /*:redrawtabp*
3152+
:redrawtabpanel various.txt /*:redrawtabpanel*
31443153
:reg change.txt /*:reg*
31453154
:registers change.txt /*:registers*
31463155
:res windows.txt /*:res*
@@ -4630,6 +4639,7 @@ E1539 vim9.txt /*E1539*
46304639
E154 helphelp.txt /*E154*
46314640
E1540 eval.txt /*E1540*
46324641
E1541 vi_diff.txt /*E1541*
4642+
E1547 various.txt /*E1547*
46334643
E155 sign.txt /*E155*
46344644
E156 sign.txt /*E156*
46354645
E157 sign.txt /*E157*
@@ -7589,6 +7599,7 @@ g:Netrw_corehandler pi_netrw.txt /*g:Netrw_corehandler*
75897599
g:Netrw_funcref pi_netrw.txt /*g:Netrw_funcref*
75907600
g:Openprg eval.txt /*g:Openprg*
75917601
g:actual_curbuf options.txt /*g:actual_curbuf*
7602+
g:actual_curtabpage options.txt /*g:actual_curtabpage*
75927603
g:actual_curwin options.txt /*g:actual_curwin*
75937604
g:ada#Comment ft_ada.txt /*g:ada#Comment*
75947605
g:ada#Ctags_Kinds ft_ada.txt /*g:ada#Ctags_Kinds*
@@ -8272,6 +8283,9 @@ hl-TOhtmlProgress syntax.txt /*hl-TOhtmlProgress*
82728283
hl-TabLine syntax.txt /*hl-TabLine*
82738284
hl-TabLineFill syntax.txt /*hl-TabLineFill*
82748285
hl-TabLineSel syntax.txt /*hl-TabLineSel*
8286+
hl-TabPanel syntax.txt /*hl-TabPanel*
8287+
hl-TabPanelFill syntax.txt /*hl-TabPanelFill*
8288+
hl-TabPanelSel syntax.txt /*hl-TabPanelSel*
82758289
hl-Terminal syntax.txt /*hl-Terminal*
82768290
hl-Title syntax.txt /*hl-Title*
82778291
hl-ToolbarButton gui.txt /*hl-ToolbarButton*
@@ -10063,6 +10077,7 @@ settagstack() builtin.txt /*settagstack()*
1006310077
setting-guifont gui.txt /*setting-guifont*
1006410078
setting-guitablabel tabpage.txt /*setting-guitablabel*
1006510079
setting-tabline tabpage.txt /*setting-tabline*
10080+
setting-tabpanel tabpage.txt /*setting-tabpanel*
1006610081
setuid change.txt /*setuid*
1006710082
setwinvar() builtin.txt /*setwinvar()*
1006810083
sftp pi_netrw.txt /*sftp*
@@ -10653,6 +10668,7 @@ tabpage.txt tabpage.txt /*tabpage.txt*
1065310668
tabpagebuflist() builtin.txt /*tabpagebuflist()*
1065410669
tabpagenr() builtin.txt /*tabpagenr()*
1065510670
tabpagewinnr() builtin.txt /*tabpagewinnr()*
10671+
tabpanel tabpage.txt /*tabpanel*
1065610672
tag tagsrch.txt /*tag*
1065710673
tag-! tagsrch.txt /*tag-!*
1065810674
tag-binary-search tagsrch.txt /*tag-binary-search*

runtime/doc/various.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*various.txt* For Vim version 9.1. Last change: 2025 Apr 21
1+
*various.txt* For Vim version 9.1. Last change: 2025 May 14
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -36,6 +36,12 @@ CTRL-L Clear and redraw the screen. The redraw may happen
3636
'tabline' includes an item that doesn't trigger
3737
automatic updating.
3838

39+
*E1547* *:redrawtabp* *:redrawtabpanel*
40+
:redrawtabp[anel] Redraw the tabline. Useful to update the tabpanel
41+
when 'tabpanel' includes an item that doesn't trigger
42+
automatic updating.
43+
44+
3945
*N<Del>*
4046
<Del> When entering a number: Remove the last digit.
4147
Note: if you like to use <BS> for this, add this
@@ -491,6 +497,7 @@ N *+statusline* Options 'statusline', 'rulerformat' and special
491497
- *+sun_workshop* Removed: |workshop|
492498
N *+syntax* Syntax highlighting |syntax|
493499
*+system()* Unix only: opposite of |+fork|
500+
H *+tabpanel* Support for |tabpanel|
494501
T *+tag_binary* binary searching in tags file |tag-binary-search|
495502
- *+tag_old_static* Removed; method for static tags |tag-old-static|
496503
- *+tag_any_white* Removed; was to allow any white space in tags files

0 commit comments

Comments
 (0)