17
17
18
18
function ! MakeHtmlAll ()
19
19
let s: log = []
20
+
21
+ " syntax hilight for `:foobar`
22
+ syn match helpBacktick contained " `" conceal
23
+ syn match helpCommand " `[^` \t ]\+ `" hs =s + 1 ,he =e - 1 contains =helpBacktick
24
+ syn match helpCommand " \( ^\| [^a-z"[]\)\z s`[^`]\+ `\z e\( [^a-z\t ."']\| $\) "hs=s+1,he=e-1 contains=helpBacktick
25
+ hi def link helpCommand Comment
26
+
20
27
call MakeTagsFile ()
21
28
echo " "
22
29
let files = split (glob (' *.??[tx]' ), ' \n' )
@@ -73,7 +80,7 @@ function! MakeHtml2(src, dst)
73
80
" set dumy highlight to keep syntax identity
74
81
if ! exists (" s:attr_save" )
75
82
let s: attr_save = {}
76
- for name in [" helpStar" , " helpBar" , " helpHyperTextEntry" , " helpHyperTextJump" , " helpOption" , " helpExample" ]
83
+ for name in [" helpStar" , " helpBar" , " helpHyperTextEntry" , " helpHyperTextJump" , " helpOption" , " helpExample" , " helpCommand " ]
77
84
let s: attr_save [name] = synIDattr (synIDtrans (hlID (name)), " name" )
78
85
execute printf (" hi %s term=bold cterm=bold gui=bold" , name)
79
86
endfor
@@ -83,12 +90,12 @@ function! MakeHtml2(src, dst)
83
90
silent ! call tohtml#Convert2HTML (1 , line (' $' ))
84
91
85
92
let lang = s: GetLang (a: src )
86
- silent % s @ <span class="\(helpHyperTextEntry\|helpHyperTextJump\|helpOption\)"> \( [^<]*\)</span> @ \= s: MakeLink (lang, submatch (1 ), submatch (2 ))@g e
93
+ silent % s @ <span class="\(helpHyperTextEntry\|helpHyperTextJump\|helpOption\|helpCommand\ )"> \( [^<]*\)</span> @ \= s: MakeLink (lang, submatch (1 ), submatch (2 ))@g e
87
94
silent % s @ ^<span class="Ignore"> < ;</span> \z e @ \& nbsp;@g e
88
95
silent % s @ <span class="\(helpStar\|helpBar\|Ignore\)"> [^<]*</span> @ @g e
89
96
call s: TranslateHelpExampleBlock ()
90
97
" remove style
91
- silent g /^\.\(helpBar\|helpStar\|helpHyperTextEntry\|helpHyperTextJump\|helpOption\)/ silent delete _
98
+ silent g /^\.\(helpBar\|helpStar\|helpHyperTextEntry\|helpHyperTextJump\|helpOption\|helpCommand\ )/ silent delete _
92
99
93
100
call s: Header ()
94
101
call s: Footer ()
@@ -155,6 +162,8 @@ function! s:MakeLink(lang, hlname, tagname)
155
162
let sep = " *"
156
163
elseif a: hlname == " helpHyperTextJump"
157
164
let sep = " |"
165
+ elseif a: hlname == " helpCommand"
166
+ let sep = " `"
158
167
elseif a: hlname == " helpOption"
159
168
let sep = " "
160
169
endif
0 commit comments