diff runtime/indent/awk.vim @ 3082:3502a7f991fc

Updated runtime files.
author Bram Moolenaar <bram@vim.org>
date Wed, 14 Sep 2011 17:55:08 +0200
parents 3fc0f57ecb91
children 887d6d91882e
line wrap: on
line diff
--- a/runtime/indent/awk.vim
+++ b/runtime/indent/awk.vim
@@ -23,6 +23,7 @@
 " 26-04-2002 Got initial version working reasonably well
 " 29-04-2002 Fixed problems in function headers and max line width
 "	     Added support for two-line if's without curly braces
+" Fixed hang: 2011 Aug 31
 
 " Only load this indent file when no other was loaded.
 if exists("b:did_indent")
@@ -118,7 +119,7 @@ function! GetAwkIndent()
 
    " 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,'(',')' )