diff runtime/indent/falcon.vim @ 11518:63b0b7b79b25

Update runtime files. commit https://github.com/vim/vim/commit/3ec574f2b549f456f664f689d6da36dc5719aeb9 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 13 18:12:01 2017 +0200 Update runtime files. Includes changing &sw to shiftwidth() for all indent scripts.
author Christian Brabandt <cb@256bit.org>
date Tue, 13 Jun 2017 18:15:04 +0200
parents a5352e73dc00
children 8b334e4cb97f
line wrap: on
line diff
--- a/runtime/indent/falcon.vim
+++ b/runtime/indent/falcon.vim
@@ -339,7 +339,7 @@ function FalconGetIndent(...)
 
     " If the previous line ended with a block opening, add a level of indent.
     if s:Match(lnum, s:block_regex)
-	return indent(s:GetMSL(lnum)) + &sw
+	return indent(s:GetMSL(lnum)) + shiftwidth()
     endif
 
     " If it contained hanging closing brackets, find the rightmost one, find its
@@ -350,20 +350,20 @@ function FalconGetIndent(...)
 	if opening.pos != -1
 	    if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
 		if col('.') + 1 == col('$')
-		    return ind + &sw
+		    return ind + shiftwidth()
 		else
 		    return virtcol('.')
 		endif
 	    else
 		let nonspace = matchend(line, '\S', opening.pos + 1) - 1
-		return nonspace > 0 ? nonspace : ind + &sw
+		return nonspace > 0 ? nonspace : ind + shiftwidth()
 	    endif
 	elseif closing.pos != -1
 	    call cursor(lnum, closing.pos + 1)
 	    normal! %
 
 	    if s:Match(line('.'), s:falcon_indent_keywords)
-		return indent('.') + &sw
+		return indent('.') + shiftwidth()
 	    else
 		return indent('.')
 	    endif
@@ -392,7 +392,7 @@ function FalconGetIndent(...)
     let col = s:Match(lnum, s:falcon_indent_keywords)
     if col > 0
 	call cursor(lnum, col)
-	let ind = virtcol('.') - 1 + &sw
+	let ind = virtcol('.') - 1 + shiftwidth()
 	" TODO: make this better (we need to count them) (or, if a searchpair
 	" fails, we know that something is lacking an end and thus we indent a
 	" level
@@ -422,9 +422,9 @@ function FalconGetIndent(...)
     " TODO: this does not take into account contrived things such as
     " module Foo; class Bar; end
     if s:Match(lnum, s:falcon_indent_keywords)
-	let ind = msl_ind + &sw
+	let ind = msl_ind + shiftwidth()
 	if s:Match(lnum, s:end_end_regex)
-	    let ind = ind - &sw
+	    let ind = ind - shiftwidth()
 	endif
 	return ind
     endif
@@ -433,7 +433,7 @@ function FalconGetIndent(...)
     " closing bracket, indent one extra level.
     if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)')
 	if lnum == p_lnum
-	    let ind = msl_ind + &sw
+	    let ind = msl_ind + shiftwidth()
 	else
 	    let ind = msl_ind
 	endif