Monday, May 2, 2016

Re: 'syntax hi [...] start=[...] stop=[...]' has no effect

2016-05-03 2:52 GMT+03:00 mwnx <mwnx@gmx.com>:
> Hello Vim users,
>
> I'm trying to get some fancy 24-bit color going with the official
> vim using escape codes such as "<Esc>[38;2;${r};${g};${b}m", which
> work on some terminals.
>
> Now, according to Vim's documentation, it's possible to highlight
> syntax regions with arbitrary terminal escape sequences using the
> 'start' and 'stop' arguments of the 'highlight' command (relevant
> help entries: highlight-start, E422, term-list, highlight-stop).
>
> However, this simply has no effect whatsoever, even when trying to
> get some basic bold text, with e.g.:
>
> hi mailSubject start=<Esc>[1m stop=<Esc>0m
>
> I've also tried "hi clear" beforehand but that doesn't help.
>
> This feature seems oddly ignored and forgotten, since my numerous
> attempts at searching for it through Google have turned up no
> relevant results, and the code for it in the git repo hasn't been
> updated since 2004, so I'm guessing the behaviour I'm getting could
> just be a bug that got in because nobody ever uses this feature.
>
> If nobody comes up with a solution or an explanation to my problem,
> I guess I'll file a bug report...

Based on the [code][1] I think it never supposed to work if t_Co is
greater then 1. But for some reason I do not see this working when
t_Co is 1 and setting start/stop for Normal highlight group. Other
groups (tested on NonText only) seem to be fine. Though `hi Normal
term=bold` neither works with t_Co set to 1.

So this feature is intended for black and white terminals and works
there. And it is documented: open `:h highlight-start` and scroll up
to "1. highlight arguments for normal terminals". Higher there is some
explanation what is normal and color terminal, though I would say
rather strange explanation (while vt100 may be black-and-white (at
least its entry does not state it supports any colors) xterm termcap
entry states it supports 8 colors (256 colors is supported by
xterm-256colors)).

[1]: https://github.com/ZyX-I/vim/blob/6b82591127b58b9ef03790cb51e867b4fd575622/src/screen.c#L7862

>
> --
> mwnx
> GPG: AEC9 554B 07BD F60D 75A3 AF6A 44E8 E4D4 0312 C726
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: