On 28 июл, 10:36, Maxim Kim <[email protected]> wrote:
> Hi,
>
> Could we have this fix in vim73?
>
> I did email original author of indent/vb.vim -- Johannes Zellner
> <johannes at zellner.org> but had no reply.
>
> Maxim.
>
>
>
> ---------- Forwarded message ----------
> From: Maxim Kim <[email protected]>
> Date: 20 авг 2009, 10:58
> Subject: VisualBasic 'elseif' indent error
> To: vim_dev
>
> Hi,
>
> I have just found thatvbindentation has error:
>
> if isBlablabla() then
>     blablabla
>     elseif isTada() then
>         Tada
>     end if
>
> It should be:
>
> if isBlablabla() then
>     blablabla
> elseif isTada() then
>     Tada
> end if

There is also one minor issue with 'if' block -- if there are spaces
after 'then' keyword then indentation is wrong.
The problem lies in line 50:
    if previous_line =~? '^\s*\<\(begin\|\%(\%(private\|public\|friend
\)\s\+\)\=\%(function\|sub\|property\)\|select\|case\|default\|if\>.\
{-}\<then\>\s*$\|else\|elseif\|do\|for\|while\|enum\|with\)\>'

See '\|if\>.\{-}\<then\>\s*$' part -- looks like it should handle
spaces at the end of 'then' but it is not.
I would remove '\>.\{-}\<then\>\s*$' as 'elseif' doesn't have that.
(Both of them should have the same indent behaviour)

updated line 50:
    if previous_line =~? '^\s*\<\%(begin\|\%(\%(private\|public\|friend
\)\s\+\)\=\%(function\|sub\|property\)\|select\|case\|default\|if\|else
\|elseif\|do\|for\|while\|enum\|with\)\>'

Maxim.

-- 
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

Raspunde prin e-mail lui