From a06143bb30921b780a9fb0999aebd068b02b2a6c Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 26 Jan 2020 03:58:09 +0000 Subject: 45345: internal: ztst.vim: Fix highlighting of zsh comments in test payload --- Util/ztst-syntax.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Util') 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 -- cgit 1.4.1