From 6cd2d5417d728ea96c5c52b34629c944a89eec60 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 11 Feb 2015 11:27:11 -0800 Subject: Update --- indent/go.vim | 9 +++++---- indent/javascript.vim | 4 ++-- indent/scala.vim | 11 ++++------- 3 files changed, 11 insertions(+), 13 deletions(-) (limited to 'indent') diff --git a/indent/go.vim b/indent/go.vim index faf4d79e..660aa506 100644 --- a/indent/go.vim +++ b/indent/go.vim @@ -37,20 +37,21 @@ function! GoIndent(lnum) let previ = indent(prevlnum) let ind = previ + let s:shiftwidth = shiftwidth() if prevl =~ '[({]\s*$' " previous line opened a block - let ind += &sw + let ind += s:shiftwidth endif if prevl =~# '^\s*\(case .*\|default\):$' " previous line is part of a switch statement - let ind += &sw + let ind += s:shiftwidth endif " TODO: handle if the previous line is a label. if thisl =~ '^\s*[)}]' " this line closed a block - let ind -= &sw + let ind -= s:shiftwidth endif " Colons are tricky. @@ -58,7 +59,7 @@ function! GoIndent(lnum) " We ignore trying to deal with jump labels because (a) they're rare, and " (b) they're hard to disambiguate from a composite literal key. if thisl =~# '^\s*\(case .*\|default\):$' - let ind -= &sw + let ind -= s:shiftwidth endif return ind diff --git a/indent/javascript.vim b/indent/javascript.vim index d483409e..0a2f839e 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -49,11 +49,11 @@ let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_st let s:line_term = '\s*\%(\%(\/\/\).*\)\=$' " Regex that defines continuation lines, not including (, {, or [. -let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@[^{;]*' . s:line_term diff --git a/indent/scala.vim b/indent/scala.vim index f533a514..4930becd 100644 --- a/indent/scala.vim +++ b/indent/scala.vim @@ -9,13 +9,9 @@ if exists("b:did_indent") endif let b:did_indent = 1 +setlocal autoindent setlocal indentexpr=GetScalaIndent() setlocal indentkeys=0{,0},0),!^F,<>>,o,O,e,=case, -setlocal autoindent -setlocal softtabstop=2 -setlocal tabstop=2 -setlocal shiftwidth=2 -setlocal expandtab if exists("*GetScalaIndent") finish @@ -543,7 +539,7 @@ function! GetScalaIndent() let ind = ind - 1 endif - if scala#LineEndsInIncomplete(curline) + if scala#LineEndsInIncomplete(prevline) call scala#ConditionalConfirm("19") return ind endif @@ -597,5 +593,6 @@ function! GetScalaIndent() return ind endfunction -" vim:set ts=2 sts=2 sw=2: + +" vim:set sw=2 sts=2 ts=8 et: " vim600:fdm=marker fdl=1 fdc=0: -- cgit v1.2.3