Skip to content

Commit

Permalink
https://github.com/vim-scripts/groovyindent-unix/pull/1
Browse files Browse the repository at this point in the history
  • Loading branch information
gt-zouyang committed Nov 27, 2020
1 parent d6fca57 commit 9adbc82
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion indent/groovy.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ setlocal cindent cinoptions& cinoptions+=j1
" The "extends" and "implements" lines start off with the wrong indent.
setlocal indentkeys& indentkeys+=0=extends indentkeys+=0=implements

" Don't de-indent things that look like labels (e.g., 'given:',
" 'when:', 'then:', etc., as found in Spock tests)
setlocal cinoptions+=L0

" Set the function to do the work.
setlocal indentexpr=GetGroovyIndent()

Expand Down Expand Up @@ -133,7 +137,7 @@ function GetGroovyIndent()
let theIndent = indent(lnum)
endif

" if last line end with (
" if last line end with (
if getline(lnum) =~ '[\(]\s*$'
let theIndent = indent(lnum) + &sw
endif
Expand Down

0 comments on commit 9adbc82

Please sign in to comment.