To: vim-dev@vim.org Subject: Patch 6.1.063 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.063 Problem: Java indenting doesn't work properly. Solution: Ignore comments when checking if the indent doesn't increase after a "}". Files: runtime/indent/java.vim *** ../vim61.062/runtime/indent/java.vim Thu Feb 28 19:46:29 2002 --- runtime/indent/java.vim Sun Apr 21 13:58:18 2002 *************** *** 1,7 **** " Vim indent file " Language: Java " Maintainer: Bram Moolenaar ! " Last Change: 2002 Feb 28 " Only load this indent file when no other was loaded. if exists("b:did_indent") --- 1,7 ---- " Vim indent file " Language: Java " Maintainer: Bram Moolenaar ! " Last Change: 2002 Apr 21 " Only load this indent file when no other was loaded. if exists("b:did_indent") *************** *** 66,72 **** " Below a line starting with "}" never indent more. Needed for a method " below a method with an indented "throws" clause. ! let lnum = prevnonblank(v:lnum - 1) if getline(lnum) =~ '^\s*}\s*\(//.*\|/\*.*\)\=$' && indent(lnum) < theIndent let theIndent = indent(lnum) endif --- 66,88 ---- " Below a line starting with "}" never indent more. Needed for a method " below a method with an indented "throws" clause. ! " First ignore comment lines. ! let lnum = v:lnum - 1 ! while lnum > 1 ! let lnum = prevnonblank(lnum) ! if getline(lnum) =~ '\*/\s*$' ! while getline(lnum) !~ '/\*' && lnum > 1 ! let lnum = lnum - 1 ! endwhile ! if getline(lnum) =~ '^\s*/\*' ! let lnum = lnum - 1 ! endif ! elseif getline(lnum) =~ '^\s*//' ! let lnum = lnum - 1 ! else ! break ! endif ! endwhile if getline(lnum) =~ '^\s*}\s*\(//.*\|/\*.*\)\=$' && indent(lnum) < theIndent let theIndent = indent(lnum) endif *** ../vim61.062/src/version.c Sun May 12 14:36:14 2002 --- src/version.c Sun May 12 18:42:46 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 63, /**/ -- While it's true that many normal people whould prefer not to _date_ an engineer, most normal people harbor an intense desire to _mate_ with them, thus producing engineerlike children who will have high-paying jobs long before losing their virginity. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///