diff options
Diffstat (limited to 'runtime/indent/java.vim')
-rw-r--r-- | runtime/indent/java.vim | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/runtime/indent/java.vim b/runtime/indent/java.vim index facbdbf571..3c48d3e35f 100644 --- a/runtime/indent/java.vim +++ b/runtime/indent/java.vim @@ -1,7 +1,12 @@ " Vim indent file " Language: Java -" Maintainer: Toby Allsopp <toby.allsopp@peace.com> (resigned) -" Last Change: 2005 Mar 28 +" Previous Maintainer: Toby Allsopp <toby.allsopp@peace.com> +" Current Maintainer: Hong Xu <xuhdev@gmail.com> +" Last Change: 2012 Jan 20 +" Version: 1.0 +" License: Same as Vim. +" Copyright (c) 2012 Hong Xu +" Before 2012, this file is maintained by Toby Allsopp. " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -60,6 +65,13 @@ function GetJavaIndent() " find start of previous line, in case it was a continuation line let lnum = SkipJavaBlanksAndComments(v:lnum - 1) + + " If the previous line starts with '@', we should have the same indent as + " the previous one + if getline(lnum) =~ '^\s*@\S\+\s*$' + return indent(lnum) + endif + let prev = lnum while prev > 1 let next_prev = SkipJavaBlanksAndComments(prev - 1) |