[PATCH] syntax/help.vim: Use concealends for helpExample to conceal > markers.

124 views
Skip to first unread message

Simon Ruderich

unread,
Aug 27, 2012, 3:58:19 PM8/27/12
to vim...@googlegroups.com
Hello,

By default the > markers of helpExample are not concealed which
causes them to be visible e.g. in transparent terminals because
the Ignore highlight group can't AFAIK make foreground text
invisible (ctermfg=NONE doesn't work for me).

The following patch adds concealends to hide them (thanks to
graywh in #vim for the idea).

Regards,
Simon
---

runtime/syntax/help.vim | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/runtime/syntax/help.vim b/runtime/syntax/help.vim
index af97543..8641d71 100644
--- a/runtime/syntax/help.vim
+++ b/runtime/syntax/help.vim
@@ -14,7 +14,7 @@ set cpo&vim
syn match helpHeadline "^[-A-Z .][-A-Z0-9 .()]*[ \t]\+\*"me=e-1
syn match helpSectionDelim "^===.*===$"
syn match helpSectionDelim "^---.*--$"
-syn region helpExample matchgroup=helpIgnore start=" >$" start="^>$" end="^[^ \t]"me=e-1 end="^<"
+syn region helpExample matchgroup=helpIgnore start=" >$" start="^>$" end="^[^ \t]"me=e-1 end="^<" concealends
if has("ebcdic")
syn match helpHyperTextJump "\\\@<!|[^"*|]\+|" contains=helpBar
syn match helpHyperTextEntry "\*[^"*|]\+\*\s"he=e-1 contains=helpStar
--
1.7.7.3

--
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

Simon Ruderich

unread,
Oct 6, 2012, 8:09:14 AM10/6/12
to vim...@googlegroups.com
On Mon, Aug 27, 2012 at 09:58:19PM +0200, Simon Ruderich wrote:
> Hello,
>
> By default the > markers of helpExample are not concealed which
> causes them to be visible e.g. in transparent terminals because
> the Ignore highlight group can't AFAIK make foreground text
> invisible (ctermfg=NONE doesn't work for me).
>
> The following patch adds concealends to hide them (thanks to
> graywh in #vim for the idea).

Any comments on this patch?

Regards,
Simon

ZyX

unread,
Oct 6, 2012, 8:25:33 AM10/6/12
to vim...@googlegroups.com, si...@ruderich.org
суббота, 6 октября 2012 г., 16:09:24 UTC+4 пользователь Simon Ruderich написал:
> > By default the > markers of helpExample are not concealed which
> > causes them to be visible e.g. in transparent terminals because
> > the Ignore highlight group can't AFAIK make foreground text
> > invisible (ctermfg=NONE doesn't work for me).
Invisible means that ctermfg is equal to ctermbg. If it does not work, specify both ctermbg in Normal group explicitly and ctermfg in Ignore group.

> Any comments on this patch?
It won’t definitely be included in the current state. See the place where “helpIgnore” is defined for example, it is 5-line definition *compatible with vim versions compiled without +conceal*.

ZyX

unread,
Oct 6, 2012, 8:31:52 AM10/6/12
to vim...@googlegroups.com, si...@ruderich.org
понедельник, 27 августа 2012 г., 23:58:19 UTC+4 пользователь Simon Ruderich написал:
> the Ignore highlight group can't AFAIK make foreground text
> invisible (ctermfg=NONE doesn't work for me).
Option “ctermfg=NONE” has meaning “let the terminal use whatever the default color is”, not something else.

Simon Ruderich

unread,
Oct 6, 2012, 9:14:15 AM10/6/12
to vim...@googlegroups.com
On Sat, Oct 06, 2012 at 05:25:33AM -0700, ZyX wrote:
> Invisible means that ctermfg is equal to ctermbg. If it does
> not work, specify both ctermbg in Normal group explicitly and
> ctermfg in Ignore group.

Not if you use e.g. urxvt with its "fake" transparency.

> It won't definitely be included in the current state. See the
> place where "helpIgnore" is defined for example, it is 5-line
> definition *compatible with vim versions compiled without
> +conceal*.

Revised patch attached.
0001-syntax-help.vim-Use-concealends-for-helpExample-to-c.patch

Simon Ruderich

unread,
Jul 6, 2013, 8:38:25 PM7/6/13
to vim...@googlegroups.com
---
Hello,

Resending this patch.

It conceals the "<" and ">" markers in the help syntax. Useful
for terminal emulators with pseudo transparency like urxvt. It
supports Vim without the conceal feature.

Regards
Simon

runtime/syntax/help.vim | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/runtime/syntax/help.vim b/runtime/syntax/help.vim
index ee5563e..1ebef74 100644
--- a/runtime/syntax/help.vim
+++ b/runtime/syntax/help.vim
@@ -14,7 +14,11 @@ set cpo&vim
syn match helpHeadline "^[-A-Z .][-A-Z0-9 .()]*[ \t]\+\*"me=e-1
syn match helpSectionDelim "^===.*===$"
syn match helpSectionDelim "^---.*--$"
-syn region helpExample matchgroup=helpIgnore start=" >$" start="^>$" end="^[^ \t]"me=e-1 end="^<"
+if has("conceal")
+ syn region helpExample matchgroup=helpIgnore start=" >$" start="^>$" end="^[^ \t]"me=e-1 end="^<" concealends
+else
+ syn region helpExample matchgroup=helpIgnore start=" >$" start="^>$" end="^[^ \t]"me=e-1 end="^<"
+endif
if has("ebcdic")
syn match helpHyperTextJump "\\\@<!|[^"*|]\+|" contains=helpBar
syn match helpHyperTextEntry "\*[^"*|]\+\*\s"he=e-1 contains=helpStar
--
1.8.3.2
signature.asc

Bram Moolenaar

unread,
Jul 7, 2013, 7:29:16 AM7/7/13
to Simon Ruderich, vim...@googlegroups.com

Simon Ruderich wrote:

> Resending this patch.
>
> It conceals the "<" and ">" markers in the help syntax. Useful
> for terminal emulators with pseudo transparency like urxvt. It
> supports Vim without the conceal feature.

Hmm, I suppose that should work. Let's include it and check it doesn't
cause problems. It does make the markers hard to spot, but that's only
a problem for someone editing the help.


--
Citizens are not allowed to attend a movie house or theater nor ride in a
public streetcar within at least four hours after eating garlic.
[real standing law in Indiana, United States of America]

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages