fix different colours of quotes in test command in sh.vim syntax file

17 views
Skip to first unread message

Олег Самойлов

unread,
Aug 29, 2019, 11:48:51 AM8/29/19
to vim_dev
Hi all.

Maintainer of sh.vim email is:

Maintainer: Charles E. Campbell <NdrO...@PcampbellAfamily.Mbiz>

I can't send email to him:

<NdrO...@PcampbellAfamily.Mbiz>: Host or domain name not found. Name service
  error for name=PcampbellAfamily.Mbiz type=AAAA: Host not found
Reporting-MTA: dns;forward102p.mail.yandex.net
X-Yandex-Queue-ID: 45F491D40600
X-Yandex-Sender: rfc822;spl...@ya.ru
Arrival-Date: Thu, 29 Aug 2019 14:47:35 +0300 (MSK)

Final-Recipient: rfc822;NdrO...@PcampbellAfamily.Mbiz
Original-Recipient: rfc822;NdrO...@PcampbellAfamily.Mbiz
Action: failed
Status: 5.4.4
Diagnostic-Code: X-Yandex; Host or domain name not found. Name service error
  for name=PcampbellAfamily.Mbiz type=AAAA: Host not found

So I send patch here.

There is a small issue with a syntax file sh.vim. Due to this issue Vim show quotes inside the test command in different colours.

It can be viewed in simple exmaple file:

#!/bin/bash

[ "$a" = "$b" ]

To fix this is a very small patch:

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index ae62e19..d798003 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -227,7 +227,7 @@ syn match shAstQuote contained '\*\ze"' nextgroup=shString
 syn match shTestOpr contained '[^-+/%]\zs=' skipwhite nextgroup=shTestDoubleQuote,shTestSingleQuote,shTestPattern
 syn match shTestOpr contained "<=\|>=\|!=\|==\|=\~\|-.\>\|-\(nt\|ot\|ef\|eq\|ne\|lt\|le\|gt\|ge\)\>\|[!<>]"
 syn match shTestPattern contained '\w\+'
-syn region shTestDoubleQuote contained start='\%(\%(\\\\\)*\\\)\@<!"' skip=+\\\\\|\\"+ end='"' contains=shDeref,shDerefSimple,shDerefSpecial
+syn region shTestDoubleQuote contained matchgroup=shQuote start='\%(\%(\\\\\)*\\\)\@<!"' skip=+\\\\\|\\"+ end='"' contains=shDeref,shDerefSimple,shDerefSpecial
 syn match shTestSingleQuote contained '\\.' nextgroup=shTestSingleQuote
 syn match shTestSingleQuote contained "'[^']*'"
 if exists("b:is_kornshell") || exists("b:is_bash")
screenshot 2019-08-29 в 14.42.07.png

Gary Johnson

unread,
Aug 29, 2019, 4:59:07 PM8/29/19
to vim_dev
On 2019-08-29, Олег Самойлов wrote:
> Hi all.
>
> Maintainer of sh.vim email is:
>
> Maintainer: Charles E. Campbell <NdrO...@PcampbellAfamily.Mbiz>
>
> I can't send email to him:
>
> <NdrO...@PcampbellAfamily.Mbiz>: Host or domain name not found. Name service
>   error for name=PcampbellAfamily.Mbiz type=AAAA: Host not found
> Reporting-MTA: dns;forward102p.mail.yandex.net
> X-Yandex-Queue-ID: 45F491D40600
> X-Yandex-Sender: rfc822;spl...@ya.ru
> Arrival-Date: Thu, 29 Aug 2019 14:47:35 +0300 (MSK)
>
> Final-Recipient: rfc822;NdrO...@PcampbellAfamily.Mbiz
> Original-Recipient: rfc822;NdrO...@PcampbellAfamily.Mbiz
> Action: failed
> Status: 5.4.4
> Diagnostic-Code: X-Yandex; Host or domain name not found. Name service error
>   for name=PcampbellAfamily.Mbiz type=AAAA: Host not found

The email address that Charles includes in his scripts contains the
letters N O S P A M. Remove those letters and what remains is his
actual email address.

Regards,
Gary

Reply all
Reply to author
Forward
0 new messages