On Sat, 21 May 2011 15:08:51 +0200
Lech Lorens <[email protected]> wrote:
> The following fragments in my scripts get highlighted as errors:
>
> #v+
> #!/bin/bash
>
> if [[ "$1" = "--offset" ]] ; then
> true
> elif [[ "$1" =~ --offset=(.*) ]] ; then
> false
> else
> true;
> false;
> fi
> #v-
>
> (parentheses and the following space).
Regex highlighting in bash conditionals isn't implemented yet, but I'll
add it soon. Right now it highlights them as plain shell words, so any
unquoted special character (like parens) triggers an error.
>
>
> #v+
> #!/bin/bash
>
> for(( ; $# > 0; ))
> do
> true
> done
> #v-
>
> (beginning with '$#' up to 'done').
As above, 'for' loop with arithmetic expressions isn't yet there (I just
forgot about it, will do it soon - it's a matter of adding few lines).
> #v+
> #!/usr/bin/env bash
>
> original=$6
> modified=${original%.svn-base}
> modified=${modified/\/.svn\/text-base/}
> #v-
>
> ('\/.svn\/text-base/').
>
> What's strange is that sometimes the last one gets highlighted
> correctly. It suffices to execute "setf sh" once again.
When it highlights the mentioned fragment as error, check if
'b:is_bash' variable is set. If it's set, it should highlight properly,
and if it's not set, then it should detect it as invalid syntax
(because it's bash-specific).
Thanks for feedback :)
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php