[runtime] Improve highlighting in help files

18 views
Skip to first unread message

Franklin, Jason

unread,
Mar 6, 2020, 9:24:09 AM3/6/20
to vim...@googlegroups.com
Greetings:

A number of section headings in help files are not highlighted properly.

For example...
1. :help undo_ftplugin
2. See FILE NAME (below) and FUNCTIONS (above) as examples

The syntax/help.vim file can be patched to fix this:

diff --git a/runtime/syntax/help.vim b/runtime/syntax/help.vim
index a8d45a4af..cd6f0b56c 100644
--- a/runtime/syntax/help.vim
+++ b/runtime/syntax/help.vim
@@ -11,7 +11,7 @@ endif
let s:cpo_save = &cpo
set cpo&vim

-syn match helpHeadline "^[-A-Z .][-A-Z0-9 .()_]*[ \t]\+\*"me=e-1
+syn match helpHeadline "^[-A-Z .][-A-Z0-9 .()_]*\ze\(\s\+\*\|$\)"
syn match helpSectionDelim "^===.*===$"
syn match helpSectionDelim "^---.*--$"
if has("conceal")

This problem can be seen all throughout the help files. This patch
improves the consistency of the help interface, IMHO.

--
Jason Franklin

signature.asc

Bram Moolenaar

unread,
Mar 6, 2020, 4:31:54 PM3/6/20
to vim...@googlegroups.com, Franklin, Jason
Thanks. I'll include and try it out to check for any trouble.

--
hundred-and-one symptoms of being an internet addict:
183. You move your coffeemaker next to your computer.

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