summaryrefslogtreecommitdiffstats
path: root/indent/scala.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2014-08-27 18:16:33 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2014-08-27 18:16:33 +0200
commitbd35da8e9ca0bddd95539bef0c8f4857dc4cc746 (patch)
tree2eda075ecdbeb5a05a536c3a91272559ee936989 /indent/scala.vim
parent91da1ec2a5e8fb926535160ef4644ff879d3ee08 (diff)
downloadvim-polyglot-bd35da8e9ca0bddd95539bef0c8f4857dc4cc746.tar.gz
vim-polyglot-bd35da8e9ca0bddd95539bef0c8f4857dc4cc746.zip
Updatev1.10.1
Diffstat (limited to 'indent/scala.vim')
-rw-r--r--indent/scala.vim14
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*\*'