about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <danielsh@apache.org>2020-01-26 03:58:09 +0000
committerDaniel Shahaf <danielsh@apache.org>2020-01-28 09:24:34 +0000
commita06143bb30921b780a9fb0999aebd068b02b2a6c (patch)
tree94b17641c2961a15724007c7e84e2ebc9071e038
parent35111697316f1b2d48144c58e0e345770bb3fb71 (diff)
downloadzsh-a06143bb30921b780a9fb0999aebd068b02b2a6c.tar.gz
zsh-a06143bb30921b780a9fb0999aebd068b02b2a6c.tar.xz
zsh-a06143bb30921b780a9fb0999aebd068b02b2a6c.zip
45345: internal: ztst.vim: Fix highlighting of zsh comments in test payload
-rw-r--r--ChangeLog5
-rw-r--r--Util/ztst-syntax.vim8
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 870588391..4b6955b67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-28  Daniel Shahaf  <danielsh@apache.org>
+
+	* 45345: Util/ztst-syntax.vim: internal: ztst.vim: Fix
+	highlighting of zsh comments in test payload
+
 2020-01-26  Daniel Shahaf  <danielsh@apache.org>
 
 	* unposted: Src/init.c: internal: Add some comments and fix
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