Your message dated Wed, 7 Nov 2007 09:00:04 -0500
with message-id <[EMAIL PROTECTED]>
and subject line Bug#450410: Acknowledgement (syntax/sh.vim: posix parameter
expansions)
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--- Begin Message ---
Package: vim
Version: 1:7.0-122+1etch3
Severity: minor
Tags: patch
Vim's syntax highlighting for shell scripts marks certain parameter
expansion patterns as errors when in /bin/sh mode, but allows them for
/bin/bash. Some of those patterns are valid posix /bin/sh, for example
${parameter%word}
${parameter%%word}
${parameter#word}
${parameter##word}
These are accepted for /bin/bash, but highlighted as errors for /bin/sh.
The attached patch allows these patterns for /bin/sh scripts as well.
-- System Information:
Debian Release: 4.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/dash
Kernel: Linux 2.6.18-4-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Versions of packages vim depends on:
ii libacl1 2.2.41-1 Access control list shared library
ii libc6 2.3.6.ds1-13etch2 GNU C Library: Shared libraries
ii libgpmg1 1.19.6-25 General Purpose Mouse - shared lib
ii libncurses5 5.5-5 Shared libraries for terminal hand
ii vim-common 1:7.0-122+1etch3 Vi IMproved - Common files
ii vim-runtime 1:7.0-122+1etch3 Vi IMproved - Runtime files
vim recommends no packages.
-- no debconf information
--- /usr/share/vim/vim70/syntax/sh.vim 2007-08-29 04:00:27.000000000 -0700
+++ /ext/home/vineet/.vim/syntax/sh.vim 2007-11-06 21:43:33.000000000 -0800
@@ -367,24 +367,26 @@
" Special ${parameter OPERATOR word} handling: {{{1
" sh ksh bash : ${parameter:-word} word is default value
+" sh ksh bash : ${parameter-word} word is default value
" sh ksh bash : ${parameter:=word} assign word as default value
+" sh ksh bash : ${parameter=word} assign word as default value
" sh ksh bash : ${parameter:?word} display word if parameter is null
+" sh ksh bash : ${parameter?word} display word if parameter is null
" sh ksh bash : ${parameter:+word} use word if parameter is not null,
otherwise nothing
-" ksh bash : ${parameter#pattern} remove small left pattern
-" ksh bash : ${parameter##pattern} remove large left pattern
-" ksh bash : ${parameter%pattern} remove small right pattern
-" ksh bash : ${parameter%%pattern} remove large right pattern
+" sh ksh bash : ${parameter+word} use word if parameter is not null,
otherwise nothing
+" sh ksh bash : ${parameter#pattern} remove small left pattern
+" sh ksh bash : ${parameter##pattern} remove large left pattern
+" sh ksh bash : ${parameter%pattern} remove small right pattern
+" sh ksh bash : ${parameter%%pattern} remove large right pattern
syn cluster shDerefPatternList contains=shDerefPattern,shDerefString
syn match shDerefOpError contained ":[[:punct:]]"
syn match shDerefOp contained ":\=[-=?]" [EMAIL PROTECTED]
syn match shDerefOp contained ":\=+" [EMAIL PROTECTED]
-if exists("b:is_bash") || exists("b:is_kornshell")
- syn match shDerefOp contained "#\{1,2}" [EMAIL PROTECTED]
- syn match shDerefOp contained "%\{1,2}" [EMAIL PROTECTED]
- syn match shDerefPattern contained "[^{}]\+"
contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape
nextgroup=shDerefPattern
- syn region shDerefPattern contained start="{" end="}"
contains=shDeref,shDerefSimple,shDerefString,shCommandSub
nextgroup=shDerefPattern
- syn match shDerefEscape contained '\%(\\\\\)*\\.'
-endif
+syn match shDerefOp contained "#\{1,2}" [EMAIL PROTECTED]
+syn match shDerefOp contained "%\{1,2}" [EMAIL PROTECTED]
+syn match shDerefPattern contained "[^{}]\+"
contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape
nextgroup=shDerefPattern
+syn region shDerefPattern contained start="{" end="}"
contains=shDeref,shDerefSimple,shDerefString,shCommandSub
nextgroup=shDerefPattern
+syn match shDerefEscape contained '\%(\\\\\)*\\.'
syn region shDerefString contained matchgroup=shOperator start=+'+
end=+'+ contains=shStringSpecial
syn region shDerefString contained matchgroup=shOperator start=+"+
skip=+\\"+ end=+"+ [EMAIL PROTECTED],shStringSpecial
syn match shDerefString contained "\\["']"
--- End Message ---
--- Begin Message ---
On Wed, Nov 07, 2007 at 08:15:07AM +0000, Vineet Kumar wrote:
> Sure enough, if I just use
>
> let g:is_posix=1 in my .vimrc, it all works as expected for
> posix-compliant features. Sorry for the noise; there's really no bug
> here.
Closing since it's a non-bug.
> I guess maybe the fact that debian doesn't ship a non-posix /bin/sh may
> cause a desire to set either is_posix or is_bash in the default config,
> so vim doesn't highlight so many errors in #!/bin/sh scripts. It's
> pretty much a separate issue, though.
I think it's been suggested before but we prefer to limit patches that
change upstream functionality. It's quite common for the various
runtime files to have different ways they can be configured so as long
as that behavior is documented and you can get it into the mode you
need, I'll leave it as is.
James
--
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[EMAIL PROTECTED]>
signature.asc
Description: Digital signature
--- End Message ---