From: Daniel Shahaf <danielsh@apache.org>
To: zsh-workers@zsh.org
Subject: [PATCH 2/3] ztst.vim: Conceal the '>' or '?' on pattern expected output / expected errput lines.
Date: Sat, 21 Dec 2019 11:43:30 +0000 [thread overview]
Message-ID: <20191221114331.18294-2-danielsh@apache.org> (raw)
In-Reply-To: <20191221114331.18294-1-danielsh@apache.org>
This aligns the expectations given by '*>' and '>' lines.
---
Test/ztst.vim | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)
diff --git a/Test/ztst.vim b/Test/ztst.vim
index 3c9e0e173..842564de2 100644
--- a/Test/ztst.vim
+++ b/Test/ztst.vim
@@ -1,6 +1,8 @@
"" A Vim syntax highlighting file for Test/*.ztst
"
-" See ../Util/zyodl.vim for installation instructions
+" See ../Util/zyodl.vim for installation instructions.
+" Also, it's recommended to 'setlocal conceallevel=3 concealcursor=nc'.
+"
" See B01cd.ztst for cases we cover
" TODO: Some zsh syntax isn't highlighted, e.g., «{ cd $0 }» doesn't highlight either 'cd' or '$0'
@@ -10,7 +12,6 @@
" I haven't found yet a legitimate use where they aren't highlighted, but
" they aren't highlighted in theoretical cases such as (( ++ZTST_skip )).
" (This example is theoretical because those variables are string-typed.)
-" TODO: for glob-like output/errput lines, conceal the '>' or '?' to align them with adjacent lines.
"" Boilerplate:
if exists("b:current_syntax")
@@ -33,11 +34,18 @@ syn region ztstTestName start=// end=/$/ contained
syn match ztstInputMarker /^</ nextgroup=ztstInput
syn region ztstInput start=// end=/$/ contained
-syn match ztstOutputMarker /^[*]\?>/ nextgroup=ztstOutput contains=ztstPatternMarker
+
+syn match ztstOutputPattern /^[*]>/ nextgroup=ztstOutput contains=ztstOutputPatternSigil,ztstOutputPatternMarker
+syn match ztstOutputPatternSigil /[*]/ contained
+syn match ztstOutputPatternMarker /[>]/ contained conceal
+syn match ztstOutputLiteral /^>/ nextgroup=ztstOutput
syn region ztstOutput start=// end=/$/ contained
-syn match ztstErrputMarker /^[*]\??/ nextgroup=ztstErrput contains=ztstPatternMarker
+
+syn match ztstErrputPattern /^[*][?]/ nextgroup=ztstErrput contains=ztstErrputPatternSigil,ztstErrputPatternMarker
+syn match ztstErrputPatternSigil /[*]/ contained
+syn match ztstErrputPatternMarker /[?]/ contained conceal
+syn match ztstErrputLiteral /^[?]/ nextgroup=ztstErrput
syn region ztstErrput start=// end=/$/ contained
-syn match ztstPatternMarker /[*]/ contained
syn match ztstFrequentExplanationMarker /^F:/ nextgroup=ztstFrequentExplanation
syn region ztstFrequentExplanation start=// end=/$/ contained
@@ -56,11 +64,14 @@ hi def link ztstTestName Title
hi def link ztstInput Normal
hi def link ztstInputMarker Ignore
hi def link ztstOutput String
-hi def link ztstOutputMarker Ignore
+hi def link ztstOutputPatternSigil Type
+hi def link ztstOutputPatternMarker Ignore
+hi def link ztstOutputLiteral Ignore
hi def link ztstErrput Identifier
-hi def link ztstErrputMarker Ignore
+hi def link ztstErrputPatternSigil Type
+hi def link ztstErrputPatternMarker Ignore
+hi def link ztstErrputLiteral Ignore
hi def link ztstDirective Statement
-hi def link ztstPatternMarker Type
hi def link ztstComment Comment
hi def link ztstFrequentExplanation PreProc
hi def link ztstFrequentExplanationMarker Ignore
next prev parent reply other threads:[~2019-12-21 11:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-21 11:43 [PATCH 1/3] Add Vim highlighting file for Test/*.ztst files Daniel Shahaf
2019-12-21 11:43 ` Daniel Shahaf [this message]
2019-12-21 11:43 ` [PATCH 3/3] ztst.vim: Highlight some more special variables Daniel Shahaf
2019-12-21 17:42 ` [PATCH 1/3] Add Vim highlighting file for Test/*.ztst files Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191221114331.18294-2-danielsh@apache.org \
--to=danielsh@apache.org \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).