From f8fc8f51c0db0137a696f65a8ba75c89c1012119 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Wed, 24 Aug 2016 11:56:33 -0400 Subject: man.vim #5249 - fix synopsis highlighting in other locales. Cannot always rely on the first line for the section in some locales; instead, use the file path and explicitly set b:man_sect to the actual section. - eliminate separate s:man_args function - simplify logic: do not reuse buffer content - introduce b:man_default_sects Fixes #5233 - introduce (man_vsplit), (man_tab) - simplify regexps --- runtime/syntax/man.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/syntax/man.vim') diff --git a/runtime/syntax/man.vim b/runtime/syntax/man.vim index 5dd41b3af5..4a527dd350 100644 --- a/runtime/syntax/man.vim +++ b/runtime/syntax/man.vim @@ -7,10 +7,10 @@ endif syntax case ignore syntax match manReference display '[^()[:space:]]\+([0-9nx][a-z]*)' -syntax match manSectionHeading display '^\%(\S.*\)\=\S$' +syntax match manSectionHeading display '^\S.*$' syntax match manTitle display '^\%1l.*$' syntax match manSubHeading display '^ \{3\}\S.*$' -syntax match manOptionDesc display '^\s\+\%(+\|--\=\)\S\+' +syntax match manOptionDesc display '^\s\+\%(+\|-\)\S\+' highlight default link manTitle Title highlight default link manSectionHeading Statement @@ -18,7 +18,7 @@ highlight default link manOptionDesc Constant highlight default link manReference PreProc highlight default link manSubHeading Function -if getline(1) =~# '^[^()[:space:]]\+([23].*' +if b:man_sect =~# '^[23]' syntax include @c $VIMRUNTIME/syntax/c.vim syntax match manCFuncDefinition display '\<\h\w*\>\ze\(\s\|\n\)*(' contained syntax region manSynopsis start='^\%( -- cgit