summaryrefslogtreecommitdiff
path: root/Util
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:17:48 +0200
committerAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:17:48 +0200
commitb09f4483416c54c1782824633dfabaf2ec0265b6 (patch)
tree304bc82642862525ae680c7fbaa249663b10ad57 /Util
parent12eb3e5356f2fc3351eed58ef1cef1b8fb83b504 (diff)
parent6e55c920503071e917619b8cb1a188cd35d772db (diff)
downloadzsh-b09f4483416c54c1782824633dfabaf2ec0265b6.tar.gz
zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.zip
New upstream version 5.8.1.2-test
Diffstat (limited to 'Util')
-rw-r--r--Util/ztst-syntax.vim21
-rw-r--r--Util/zyodl.vim24
2 files changed, 38 insertions, 7 deletions
diff --git a/Util/ztst-syntax.vim b/Util/ztst-syntax.vim
index a39fe3fbb..639b9a4ec 100644
--- a/Util/ztst-syntax.vim
+++ b/Util/ztst-syntax.vim
@@ -35,22 +35,22 @@ syn match ztstPayload /^\s.*/ contains=@zsh
syn match ztstExitCode /^\d\+\|^-/ nextgroup=ztstFlags
syn match ztstFlags /[.dDqf]*:/ contained nextgroup=ztstTestName contains=ztstColon
-syn match ztstColon /:/ contained
+syn match ztstColon /:.\@=/ contained
syn region ztstTestName start=// end=/$/ contained
-syn match ztstInputMarker /^</ nextgroup=ztstInput
+syn match ztstInputMarker /^<.\@=/ nextgroup=ztstInput
syn region ztstInput start=// end=/$/ contained
syn match ztstOutputPattern /^[*]>/ nextgroup=ztstOutput contains=ztstOutputPatternSigil,ztstOutputPatternMarker
syn match ztstOutputPatternSigil /[*]/ contained
-syn match ztstOutputPatternMarker /[>]/ contained conceal
-syn match ztstOutputLiteral /^>/ nextgroup=ztstOutput
+syn match ztstOutputPatternMarker /[>].\@=/ contained conceal
+syn match ztstOutputLiteral /^>.\@=/ nextgroup=ztstOutput
syn region ztstOutput start=// end=/$/ contained
syn match ztstErrputPattern /^[*][?]/ nextgroup=ztstErrput contains=ztstErrputPatternSigil,ztstErrputPatternMarker
syn match ztstErrputPatternSigil /[*]/ contained
-syn match ztstErrputPatternMarker /[?]/ contained conceal
-syn match ztstErrputLiteral /^[?]/ nextgroup=ztstErrput
+syn match ztstErrputPatternMarker /[?].\@=/ contained conceal
+syn match ztstErrputLiteral /^[?].\@=/ nextgroup=ztstErrput
syn region ztstErrput start=// end=/$/ contained
syn match ztstFrequentExplanationMarker /^F:/ nextgroup=ztstFrequentExplanation
@@ -75,6 +75,15 @@ syn keyword ztstSpecialVariable ZTST_unimplemented ZTST_skip ZTST_testdir ZTST_f
syn sync maxlines=1
"" Highlight groups:
+" Note: every group that's defaulted to "Ignore" has a match pattern that ends
+" with /.\@=/. This ensures the Ignore will only be effective if there is an
+" immediately following group that _will_ be highlighted. (That group will be
+" one of ztstTestName, ztstInput, ztstOutput, and ztstErrput.)
+"
+" ### The Ignore would still apply if the rest of the line is all-whitespace.
+" ###
+" ### If you run into such lines, consider setting the 'list' and 'listchars'
+" ### options appropriately.
hi def link ztstExitCode Number
hi def link ztstFlags Normal
hi def link ztstColon Ignore
diff --git a/Util/zyodl.vim b/Util/zyodl.vim
index 7acd1dfaf..7579365ac 100644
--- a/Util/zyodl.vim
+++ b/Util/zyodl.vim
@@ -12,6 +12,11 @@
" autocmd BufRead,BufNewFile **/Doc/Zsh/*.yo setfiletype zyodl
" Or alternatively:
" 1. Append the contents of Doc/Zsh/.vimrc to your .vimrc, changing «<sfile>» to «%».
+"
+" You may also wish to set:
+" autocmd FileType zyodl setlocal conceallevel=2
+" in order to benefit from the 'conceal' behaviour for LPAR(), RPAR(), and
+" friends.
"" Test case:
" texinode()()()()
@@ -49,7 +54,6 @@ syn region zyodlVar start="\<var(" end=")" contains=zyodlSpecial,zyodlPa
syn region zyodlBold start="\<bf(" end=")" contains=zyodlSpecial,zyodlParenthetical
syn region zyodlEmph start="\<em(" end=")" contains=zyodlSpecial,zyodlParenthetical
syn region zyodlIndex start="\<.index(" end=")" contains=zyodlSpecial
-syn match zyodlSpecial "+\?\<\(LPAR\|RPAR\|PLUS\)()"
syn match zyodlNumber "\d\+"
syn region zyodlItem start="\<xitem(" end=")" contains=zyodlSpecial,@zyodlInline
syn region zyodlItem start="\<item(" end=")" contains=zyodlSpecial,@zyodlInline
@@ -70,6 +74,19 @@ syn keyword zyodlKeyword sitem nextgroup=zyodlSItemArg1
syn region zyodlSItemArg1 oneline start="(" end=")" contains=zyodlSpecial,@zyodlInline nextgroup=zyodlSItemArg2 contained
syn region zyodlSItemArg2 start="(" end=")" contains=zyodlSpecial,@zyodlInline contained skip="\w\@<!([^)]*)"
+" Miscellany
+syn match zyodlLineJoiner /\\$/
+syn keyword zyodlNote note Note NOTE
+
+syn keyword zyodlBullet itemiz conceal cchar=•
+syn match zyodlSpecial "\<DASH()-" conceal cchar=—
+syn match zyodlSpecial "+\?LPAR()" conceal cchar=(
+syn match zyodlSpecial "+\?RPAR()" conceal cchar=)
+syn match zyodlSpecial "+\?_LPAR_" conceal cchar=(
+syn match zyodlSpecial "+\?_RPAR_" conceal cchar=)
+syn match zyodlSpecial "+\?PLUS()" conceal cchar=+
+syn match zyodlFAQDash "+\?\<emdash()" conceal cchar=—
+
"" Highlight groups:
hi def link zyodlTt Constant
hi def link zyodlVar Identifier
@@ -87,6 +104,11 @@ hi def link zyodlCond Conditional
hi def link zyodlRef Include
hi def link zyodlSItemArg1 Macro
hi def link zyodlSItemArg2 Underlined
+hi def link zyodlLineJoiner Special
+hi def link zyodlNote Todo
+
+"" Derived highlighting groups:
+hi def link zyodlFAQDash zyodlSpecial
let b:current_syntax = "zyodl"
let &cpo = s:cpo_save