man.vim: improve manSentence regex (#8764)

ref https://github.com/neovim/neovim/pull/8709#issuecomment-406319186
This commit is contained in:
Synray 2018-07-22 09:30:38 -07:00 committed by Justin M. Keyes
parent 94841e5eae
commit 13d29cb9ed

View File

@ -34,19 +34,18 @@ if b:man_sect =~# '^[023]'
syntax case match syntax case match
syntax include @c $VIMRUNTIME/syntax/c.vim syntax include @c $VIMRUNTIME/syntax/c.vim
syntax match manCFuncDefinition display '\<\h\w*\>\ze\(\s\|\n\)*(' contained syntax match manCFuncDefinition display '\<\h\w*\>\ze\(\s\|\n\)*(' contained
syntax match manSentence display '\%(^ \{3,7}\u\|\. \u\)\_.\{-} syntax match manLowerSentence /\n\s\{7}\l.\+[()]\=\%(\:\|.\|-\)[()]\=[{};]\@<!\n$/ display keepend contained contains=manReference
\\%(-$\|\.$\|:$\)\| syntax region manSentence start=/^\s\{7}\%(\u\|\*\)[^{}=]*/ end=/\n$/ end=/\ze\n\s\{3,7}#/ keepend contained contains=manReference
\ \{3,7}\a.*\%(\.\|:\)$' contained contains=manReference
syntax region manSynopsis start='^\%( syntax region manSynopsis start='^\%(
\SYNOPSIS\| \SYNOPSIS\|
\SYNTAX\| \SYNTAX\|
\SINTASSI\| \SINTASSI\|
\SKŁADNIA\| \SKŁADNIA\|
\СИНТАКСИС\| \СИНТАКСИС\|
\書式\)$' end='^\%(\S.*\)\=\S$' keepend contains=manSentence,manSectionHeading,@c,manCFuncDefinition \書式\)$' end='^\%(\S.*\)\=\S$' keepend contains=manLowerSentence,manSentence,manSectionHeading,@c,manCFuncDefinition
highlight default link manCFuncDefinition Function highlight default link manCFuncDefinition Function
syntax region manExample start='^EXAMPLES\=$' end='^\%(\S.*\)\=\S$' keepend contains=manSentence,manSectionHeading,manSubHeading,@c,manCFuncDefinition syntax region manExample start='^EXAMPLES\=$' end='^\%(\S.*\)\=\S$' keepend contains=manLowerSentence,manSentence,manSectionHeading,manSubHeading,@c,manCFuncDefinition
" XXX: groupthere doesn't seem to work " XXX: groupthere doesn't seem to work
syntax sync minlines=500 syntax sync minlines=500