zsh-workers
 help / color / mirror / Atom feed
* [PATCH] internal: ztst.vim: Fix highlighting of zsh comments in test payload
@ 2020-01-26  3:58 Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2020-01-26  3:58 UTC (permalink / raw)
  To: zsh-workers

---
 Util/ztst-syntax.vim | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Util/ztst-syntax.vim b/Util/ztst-syntax.vim
index 01e4dae31..a39fe3fbb 100644
--- a/Util/ztst-syntax.vim
+++ b/Util/ztst-syntax.vim
@@ -25,7 +25,13 @@ syn clear
 
 syn include @zsh                   syntax/zsh.vim
 
-syn match  ztstPayload             /^\s\+\zs.*/ contains=@zsh
+" Note that we don't do /^\s\zs.*/ here.  If we did that, lines that start
+" with " #" (a space and a hash sign) would not be highlighted as comments,
+" because zshComment's patterns won't match unless the '#' is preceded by
+" a space or start-of-line.  See:
+"
+" https://github.com/chrisbra/vim-zsh/issues/21#issuecomment-577738791
+syn match  ztstPayload             /^\s.*/ contains=@zsh
 
 syn match  ztstExitCode            /^\d\+\|^-/                nextgroup=ztstFlags
 syn match  ztstFlags               /[.dDqf]*:/      contained nextgroup=ztstTestName contains=ztstColon

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-26  3:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-26  3:58 [PATCH] internal: ztst.vim: Fix highlighting of zsh comments in test payload Daniel Shahaf

zsh-workers

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


code repositories for the project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git