Bug#712657: sh-syntax classifies $() as error

martin f krafft madduck at debian.org
Tue Jun 18 10:55:42 UTC 2013

Package: vim-runtime
Version: 2:7.3.547-7
Severity: normal
File: /usr/share/vim/vim73/syntax/sh.vim
Tags: patch

This $(shell construct) is almost identical to `this one`, except
the first implicitly quotes the result and may be arbitrarily
nested. Both are POSIX-compliant.

The sh syntax plugin unfortunately claims that $(such an expression)
is an error and causes the leader and closing parentheses to be
highlighted as Error.

Line 258ff. of the file explains what's going on.

Since all Debian shells including dash (the default) support $(),
I suggest to either remove the conditional in that paragraph, or to
apply the following minimal patch in the Debian package.

--- -   2013-06-18 12:54:43.124660035 +0200
+++ .vim/syntax/sh.vim  2013-06-18 12:54:15.839065086 +0200
@@ -260,7 +261,7 @@
 " (ie. Posix compliant shell).  /bin/ksh should work for those
 " systems too, however, so the following syntax will flag $(..) as
 " an Error under /bin/sh.  By consensus of vimdev'ers!
-if exists("b:is_kornshell") || exists("b:is_bash")
+if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_sh")
  syn region shCommandSub matchgroup=shCmdSubRegion start="\$("  skip='\\\\\|\\.' end=")"  contains=@shCommandSubList
  syn region shArithmetic matchgroup=shArithRegion  start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList
  syn region shArithmetic matchgroup=shArithRegion  start="\$\[" skip='\\\\\|\\.' end="\]" contains=@shArithList

-- System Information:
Debian Release: 7.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.8-trunk-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_NZ, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

vim-runtime depends on no packages.

Versions of packages vim-runtime recommends:
ii  vim            2:7.3.547-7
ii  vim-gtk [vim]  2:7.3.547-7

vim-runtime suggests no packages.

-- no debconf information

 .''`.   martin f. krafft <madduck at d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
-------------- next part --------------
A non-text attachment was scrubbed...
Name: digital_signature_gpg.asc
Type: application/pgp-signature
Size: 1124 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)
URL: <http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/attachments/20130618/8b085613/attachment.sig>

More information about the pkg-vim-maintainers mailing list