On 16/09/09 20:59, Patrick Gen-Paul wrote:
[...]
>>> I'm curious as to why the tab line was implemented this way rather than
>>> something like the status line. I'm not complaining, mind you, writing a
>>> simple function was definitely a fun and useful experience - vim is an
>>> editor for programmers, not a word processor, right ;-) - but I'm not
>>> sure why it was not done the same way for the terminal as for the gui -
>>> cf. :h set guitablabel..?
>>
>> it _was_ done like the status line i.e. for the whole width. You can
>> display what you want in it, even just the number of the current tab...
>
> With gvim, something like ":set guitablabel=%N\ %f" defines a template
> for your labels and vim automatically takes care of building each actual
> label.
>
> Unless I missed something, the equivalent option is not available for
> users of non-gui vim.
>
> What I meant initially was that whereas with gvim, basic tab line
> customization is provided in a way that's similar to the status line,
> with non-gui vim, you cannot define a template, and customizing your tab
> line requires that you write code that will create it dynamically.
>
> Could this be because the tab line was first felt to be something that
> would fit in nicely with the gui model, and only implemented in terminal
> vim as an afterthought?
[...]
With 'statusline', you define the _whole_ statusline (for the full width
of the screen), and Vim repeatedly parses the option value at runtime
-dynamically- to make appear or disappear the [+], line, column,
filename, whatever.
With 'tabline', which, IIRC, appeared in Vim 7.0 alpha shortly _before_
'guitablabel' (as I already mentioned but apparently you didn't even see
that, and snipped it when replying), you _also_ define the tabline for
the whole width; however, due to its repetitive character, you have to
do it by means of a ":while" loop, which means using a function, which
was accounted for via a new statusline-like code, namely %!, to evaluate
the whole line as the return value of a function. That code could then
also be used for the 'statusline' option but IIRC it appeared together
with the 'tabline' option.
If you want to separate text-style labels by putting / dividers left of
the current label and \ ones right of it, you can, but you don't have
to. You can also use | as separator between labels, or just a space,
with maybe a change of highlight for the current tab.
For "gui-style" tab labels, the OS takes care of the decorations, and
gvim has to define separately the contents of one tab label at a time.
You can't define what kind of separators you want, the OS decides that
for you. IIRC implementing this option required some more thinking and
was implemented as an afterthought, not the other way round. It also
imposes more limitations on what you can display; and if you want
GUI-style tab labels in the GUI and a text-style tab line in Console Vim
you have to define both 'tabline' and 'guitablabel' separately; OTOH it
is quite possible to use a text-style tabline in both (I do), and in
that case you can dispense with 'guitablabel'.
Best regards,
Tony.
--
The rain it raineth on the just
And also on the unjust fella,
But chiefly on the just, because
The unjust steals the just's umbrella.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---