Hi Charles!

On Mi, 31 Aug 2011, Charles Campbell wrote:

(CC maintainer of the indent script)
> Donald Allen wrote:
> >         baz["FOO"]=");\n";
> >         baz["BAR"]=");\n";
> I performed some tests with this.
> 
> * I can duplicate this behavior
> * the delete and put steps are unnecessary.  Just have a file with
> three lines,
>   -blank line-
>         baz["FOO"]=");\n";
>         baz["FOO"]=");\n";
> 
> and perform:
>   2G
>   o
> 
> * using  vim -u simple.vimrc filename.awk and with simple.vimrc containing:
>   set nocp
>   filetype indent on
> 
> So clearly this problem involves the indent/awk.vim script.

Yeas, it is running in an endless loop. Because it doesn't check that 
the line number is still valid.
I think, this patch fixes it:
--- awk.vim.orig        2011-08-31 18:21:18.516344489 +0200
+++ awk.vim     2011-08-31 18:21:12.406335526 +0200
@@ -118,7 +118,7 @@
 
    " Case 1
    if prev_data =~ ')' && brace_balance < 0
-      while brace_balance != 0
+      while brace_balance != 0 && prev_lineno > 0
         let prev_lineno = s:Get_prev_line( prev_lineno )
         let prev_data = getline( prev_lineno )
         let brace_balance=brace_balance+s:Get_brace_balance(prev_data,'(',')' )


regards,
Christian

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