четверг, 2 августа 2012 г., 16:07:29 UTC+4 пользователь Shougo написал:
> Hi, I found the problem in indent/vim.vim.
>
>
>
> > elseif getline(lnum) =~ '^\s*aug\%[roup]' && getline(lnum) !~
> > '^\s*aug\%[roup]\s*!\=\s\+END'
>
> > let ind = ind + &sw
>
> > else
>
> > let line = getline(lnum)
>
> > let i = match(line,
> > '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>')
>
> > if i >= 0
>
> > let ind += &sw
>
> > if strpart(line, i, 1) == '|' && has('syntax_items')
>
> > \ && synIDattr(synID(lnum, i, 1), "name") =~
> > '\(Comment\|String\)$'
>
> > let ind -= &sw
>
> > endif
>
> > endif
>
>
>
> The match uses "=~" and "!~" instead of "=~" and "!~".
>
> So if set ignorecase, the indentation is wrong.
>
> I fixed the problem. Would you check it?
>
> Note: Same problem may be in other indentation plugins. But I don't check.
Why don't fix the problem by explicitely using "[=!][~=][#?]" everywhere? I
just always use "#" and "?" for string comparison, no matter whether it is
"=~", "is" or their opposites (yes, and I never use "=="/"!=" for string
comparison). All the problems should be fixed by running
perl -p -i -e 's/(?<=[!=]~)(?![?#])/#/g unless /^\s*setlocal/' indent/*.vim
additionally reviewing changes when processing plugins for languages which
contain this operator. The result seem to be harmless:
http://bpaste.net/show/38213/.
--
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