Philipp Edelmann wrote: > Dear Vim developers, > > I noticed certain cases which cause Vim's indentation for awk to go into > an infinite loop. The problem appears when there is a negative brace > balance, i.e. more closing braces than opening braces. This can easily > happen if one uses a regexp to match a closing brace. Vim then moves > upward through the file to find the corresponding opening brace, which > does not exist. The loop is missing a break condition for the case that > line 0 has been reached. I added it in my patch. > > You see for yourself by opening the attached demo.awk and inserting a > line below "match". > > Additionally, I think that strings and computed regexps should not be > scanned for matching braces at all when it comes to determining the > indentation. I changed the Get_brace_balance function to strip "..." and > /.../ while taking into account escape characters. I am novice in > writing Vim script and I'd be glad if somebody found a more elegant way > of doing this but at least it seems to give proper indentation now. > > The attached patch should apply to the current version of indent/awk.vim.
Have you tried contacting the author, Erik Janssen? -- A village. Sound of chanting of Latin canon, punctuated by short, sharp cracks. It comes nearer. We see it is a line of MONKS ala SEVENTH SEAL flagellation scene, chanting and banging themselves on the foreheads with wooden boards. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- 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