aboutsummaryrefslogtreecommitdiff
path: root/runtime/indent/scala.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-11-06 05:26:57 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-11-06 05:35:32 +0100
commitc348f84f218434580209a2c52552ba8fbbf1864b (patch)
tree23aa73c016b3f3941917605cd1742dfe8ca7e1fd /runtime/indent/scala.vim
parent93fb7383a330f03bf64ed5558a8e16ea4c742478 (diff)
downloadrneovim-c348f84f218434580209a2c52552ba8fbbf1864b.tar.gz
rneovim-c348f84f218434580209a2c52552ba8fbbf1864b.tar.bz2
rneovim-c348f84f218434580209a2c52552ba8fbbf1864b.zip
vim-patch:036986f1507d
Update runtime files. https://github.com/vim/vim/commit/036986f1507d223549d110af300144468bd3a1f7
Diffstat (limited to 'runtime/indent/scala.vim')
-rw-r--r--runtime/indent/scala.vim34
1 files changed, 17 insertions, 17 deletions
diff --git a/runtime/indent/scala.vim b/runtime/indent/scala.vim
index f97c79bbab..6fd8ca9d81 100644
--- a/runtime/indent/scala.vim
+++ b/runtime/indent/scala.vim
@@ -412,24 +412,24 @@ function! GetScalaIndent()
if prevline =~ '^\s*\.'
return ind
else
- return ind + &shiftwidth
+ return ind + shiftwidth()
endif
endif
" Indent html literals
if prevline !~ '/>\s*$' && prevline =~ '^\s*<[a-zA-Z][^>]*>\s*$'
call scala#ConditionalConfirm("3")
- return ind + &shiftwidth
+ return ind + shiftwidth()
endif
" assumes curly braces around try-block
if curline =~ '^\s*}\s*\<catch\>'
- return ind - &shiftwidth
+ return ind - shiftwidth()
elseif curline =~ '^\s*\<catch\>'
return ind
endif
- " Add a 'shiftwidth' after lines that start a block
+ " Add a shiftwidth()' after lines that start a block
" If 'if', 'for' or 'while' end with ), this is a one-line block
" If 'val', 'var', 'def' end with =, this is a one-line block
if (prevline =~ '^\s*\<\%(\%(}\?\s*else\s\+\)\?if\|for\|while\)\>.*[)=]\s*$' && scala#NumberOfBraceGroups(prevline) <= 1)
@@ -438,7 +438,7 @@ function! GetScalaIndent()
\ || prevline =~ '^\s*\%(}\s*\)\?\<else\>\s*$'
\ || prevline =~ '=\s*$'
call scala#ConditionalConfirm("4")
- let ind = ind + &shiftwidth
+ let ind = ind + shiftwidth()
elseif prevline =~ '^\s*\<\%(}\?\s*else\s\+\)\?if\>' && curline =~ '^\s*}\?\s*\<else\>'
return ind
endif
@@ -447,7 +447,7 @@ function! GetScalaIndent()
let bracketCount = scala#CountBrackets(prevline, '{', '}')
if bracketCount > 0 || prevline =~ '.*{\s*$'
call scala#ConditionalConfirm("5b")
- let ind = ind + &shiftwidth
+ let ind = ind + shiftwidth()
elseif bracketCount < 0
call scala#ConditionalConfirm("6b")
" if the closing brace actually completes the braces entirely, then we
@@ -475,7 +475,7 @@ function! GetScalaIndent()
let bracketCount = scala#CountBrackets(prevline, '(', ')')
if bracketCount > 0 || prevline =~ '.*(\s*$'
call scala#ConditionalConfirm("5a")
- let ind = ind + &shiftwidth
+ let ind = ind + shiftwidth()
elseif bracketCount < 0
call scala#ConditionalConfirm("6a")
" if the closing brace actually completes the braces entirely, then we
@@ -497,7 +497,7 @@ function! GetScalaIndent()
else
" This is the only part that's different from from the '{', '}' one below
" Yup... some refactoring is necessary at some point.
- let ind = ind + (bracketCount * &shiftwidth)
+ let ind = ind + (bracketCount * shiftwidth())
let lineCompletedBrackets = 1
endif
endif
@@ -506,10 +506,10 @@ function! GetScalaIndent()
if curline =~ '^\s*}\?\s*\<else\>\%(\s\+\<if\>\s*(.*)\)\?\s*{\?\s*$' &&
\ ! scala#LineIsCompleteIf(prevline) &&
\ prevline !~ '^.*}\s*$'
- let ind = ind - &shiftwidth
+ let ind = ind - shiftwidth()
endif
- " Subtract a 'shiftwidth' on '}' or html
+ " Subtract a shiftwidth()' on '}' or html
let curCurlyCount = scala#CountCurlies(curline)
if curCurlyCount < 0
call scala#ConditionalConfirm("14a")
@@ -517,7 +517,7 @@ function! GetScalaIndent()
return indent(matchline)
elseif curline =~ '^\s*</[a-zA-Z][^>]*>'
call scala#ConditionalConfirm("14c")
- return ind - &shiftwidth
+ return ind - shiftwidth()
endif
let prevParenCount = scala#CountParens(prevline)
@@ -529,7 +529,7 @@ function! GetScalaIndent()
let prevCurlyCount = scala#CountCurlies(prevline)
if prevCurlyCount == 0 && prevline =~ '^.*\%(=>\|⇒\)\s*$' && prevline !~ '^\s*this\s*:.*\%(=>\|⇒\)\s*$' && curline !~ '^\s*\<case\>'
call scala#ConditionalConfirm("16")
- let ind = ind + &shiftwidth
+ let ind = ind + shiftwidth()
endif
if ind == originalIndentValue && curline =~ '^\s*\<case\>'
@@ -555,7 +555,7 @@ function! GetScalaIndent()
if scala#LineIsAClosingXML(prevline)
if scala#LineCompletesXML(prevlnum, prevline)
call scala#ConditionalConfirm("20a")
- return ind - &shiftwidth
+ return ind - shiftwidth()
else
call scala#ConditionalConfirm("20b")
return ind
@@ -566,7 +566,7 @@ function! GetScalaIndent()
"let indentMultiplier = scala#LineCompletesDefValr(prevlnum, prevline)
"if indentMultiplier != 0
" call scala#ConditionalConfirm("19a")
- " let ind = ind - (indentMultiplier * &shiftwidth)
+ " let ind = ind - (indentMultiplier * shiftwidth())
let defValrLine = scala#Test(prevlnum, prevline, '{', '}')
if defValrLine != -1
call scala#ConditionalConfirm("21a")
@@ -575,10 +575,10 @@ function! GetScalaIndent()
call scala#ConditionalConfirm("21b")
if scala#GetLine(prevnonblank(prevlnum - 1)) =~ '^.*\<else\>\s*\%(//.*\)\?$'
call scala#ConditionalConfirm("21c")
- let ind = ind - &shiftwidth
+ let ind = ind - shiftwidth()
elseif scala#LineCompletesIfElse(prevlnum, prevline)
call scala#ConditionalConfirm("21d")
- let ind = ind - &shiftwidth
+ let ind = ind - shiftwidth()
elseif scala#CountParens(curline) < 0 && curline =~ '^\s*)' && scala#GetLine(scala#GetLineThatMatchesBracket('(', ')')) =~ '.*(\s*$'
" Handles situations that look like this:
"
@@ -592,7 +592,7 @@ function! GetScalaIndent()
" 10
" ).somethingHere()
call scala#ConditionalConfirm("21e")
- let ind = ind - &shiftwidth
+ let ind = ind - shiftwidth()
endif
endif
endif