diff options
Diffstat (limited to 'indent/scala.vim')
-rw-r--r-- | indent/scala.vim | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/indent/scala.vim b/indent/scala.vim index 4053a83c..f533a514 100644 --- a/indent/scala.vim +++ b/indent/scala.vim @@ -36,12 +36,12 @@ endfunction function! scala#GetLine(lnum) let line = substitute(getline(a:lnum), '//.*$', '', '') - let line = substitute(line, '"[^"]*"', '""', 'g') + let line = substitute(line, '"\(.\|\\"\)\{-}"', '""', 'g') return line endfunction function! scala#CountBrackets(line, openBracket, closedBracket) - let line = substitute(a:line, '"\(.\|\\"\)*"', '', 'g') + let line = substitute(a:line, '"\(.\|\\"\)\{-}"', '', 'g') let open = substitute(line, '[^' . a:openBracket . ']', '', 'g') let close = substitute(line, '[^' . a:closedBracket . ']', '', 'g') return strlen(open) - strlen(close) @@ -102,7 +102,7 @@ function! scala#CurlyMatcher() if scala#CountParens(scala#GetLine(matchline)) < 0 let savedpos = getpos('.') call setpos('.', [savedpos[0], matchline, 9999, savedpos[3]]) - call searchpos('{', 'Wb') + call searchpos('{', 'Wbc') call searchpos(')', 'Wb') let [lnum, colnum] = searchpairpos('(', '', ')', 'Wbn') call setpos('.', savedpos) @@ -133,7 +133,7 @@ function! scala#GetLineAndColumnThatMatchesBracket(openBracket, closedBracket) call searchpos(a:closedBracket . '\ze[^' . a:closedBracket . a:openBracket . ']*' . a:openBracket, 'W') else call setpos('.', [savedpos[0], savedpos[1], 9999, savedpos[3]]) - call searchpos(a:closedBracket, 'Wb') + call searchpos(a:closedBracket, 'Wbc') endif let [lnum, colnum] = searchpairpos(a:openBracket, '', a:closedBracket, 'Wbn') call setpos('.', savedpos) @@ -382,7 +382,11 @@ function! GetScalaIndent() let curline = scala#GetLine(curlnum) if prevline =~ '^\s*/\*\*' - return ind + 1 + if prevline =~ '\*/\s*$' + return ind + else + return ind + 1 + endif endif if curline =~ '^\s*\*' |