Sunday, November 4, 2012

Re: 'opt' vs. |'opt'| in help files

On 04/11/12 14:41, Andy Wokula wrote:
> Am 04.11.2012 11:43, schrieb Andre Majorel:
>> When an option is mentioned in the help files, sometimes, it's
>> "'option'", sometimes "|'option'|". Since ^] works just as well
>> on the former, what's the point of adding the "|" ? Is it just a
>> leftover from a time when ^] required them ?
>
> The 'option' notation makes up different highlighting for option names.
> It's not a preparation for CTRL-] ... CTRL-] actually works on every
> word in the text. And on a visual selection.
>

When a word is between single quotes, Ctrl-] includes the quotes in the
searched tag. The use in the helpfiles is not perfectly consistent: e.g.
at lines 6270-6279 of eval.txt:

> browsefilter Compiled with support for |browsefilter|.
> builtin_terms Compiled with some builtin terminals.
> byte_offset Compiled with support for 'o' in 'statusline'
> cindent Compiled with 'cindent' support.
> clientserver Compiled with remote invocation support |clientserver|.
> clipboard Compiled with 'clipboard' support.
> cmdline_compl Compiled with |cmdline-completion| support.
> cmdline_hist Compiled with |cmdline-history| support.
> cmdline_info Compiled with 'showcmd' and 'ruler' support.
> comments Compiled with |'comments'| support.

Here, option names are shown mostly without bars (in bold green), but
|'comments'| appears with bars (in light green) with no obvious reason
for the difference. In the byte_offset line, 'o' is not highlighted,
which is correct. Double-clicking it still tries (and fails) to find
help for 'o', which is also correct: double-clicking or hitting Ctrl-]
anywhere in a helpfile will attempt to find help for whatever is under
the mouse pointer or cursor, respectively.

In current versions of Vim, when syntax highlighting is enabled, the
bars are by default made invisible both by linking helpBar to Ignore and
by means of the "conceal" feature; they can be made visible (as they
used to be in Vim 6) by linking it to helpHyperTextJump instead, and by
setting 'conceallevel' to zero (e.g. in ~/.vim/after/syntax/help.vim).
Similarly for helpStar and helpHyperTextEntry for the *stars* around
helptag definitions.

I suppose that the use of 'optionname' vs. |'optionname'| answers (not
always obvious) stylistic criteria, in order to make them appear 'bold'
or |'unbold'|.


Best regards,
Tony.
--
The man who sets out to carry a cat by its tail learns something that
will always be useful and which never will grow dim or doubtful.
-- Mark Twain.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: