Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 121101 - sh.vim broken for ${foo/pattern} expansions
Summary: sh.vim broken for ${foo/pattern} expansions
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-31 14:22 UTC by Ed Catmur
Modified: 2006-01-31 19:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
sh.vim-bash-pps.patch (sh.vim-bash-pps.patch,694 bytes, patch)
2006-01-31 14:23 UTC, Ed Catmur
Details | Diff
sh.vim-paren-in-case.patch (sh.vim-paren-in-case.patch,1.07 KB, patch)
2006-01-31 19:04 UTC, Ed Catmur
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Catmur 2006-01-31 14:22:49 UTC
The sh.vim syntax highlighting does not correctly handle parameter expansions of the form ${parameter/pattern}. I'm not sure whether they're legal bash - the man page seems to imply one should use ${parameter/pattern/} - but they work and are used extensively, e.g. in /usr/lib/portage/bin/ebuild.sh.

I attach a patch.
Comment 1 Ed Catmur 2006-01-31 14:23:47 UTC
Created attachment 78598 [details, diff]
sh.vim-bash-pps.patch

To vim-core 6.4.
Comment 2 Ciaran McCreesh 2006-01-31 14:35:23 UTC
Please send this upstream (if it hasn't been fixed already -- it's been reported). I'm really trying to cut back on syntax patches if at all possible.
Comment 3 Ed Catmur 2006-01-31 17:48:38 UTC
Ah... yes, it is fixed upstream: http://cvs.sourceforge.net/viewcvs.py/vim/vim7/runtime/syntax/sh.vim?r1=1.10&r2=1.11&diff_format=u

I've also found a bug in case...esac highlighting not fixed upstream; I'll upstream it and not bother you with it (unless vim7 comes out without it).
Comment 4 Ed Catmur 2006-01-31 19:04:46 UTC
Created attachment 78611 [details, diff]
sh.vim-paren-in-case.patch

This fixes

case $x in
    ')' ) echo "x is a paren";;
esac

I've upstreamed it; I'm just putting it here for completeness.