summaryrefslogtreecommitdiffstats
path: root/runtime/indent/liquid.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-08-30 23:26:57 +0200
committerBram Moolenaar <Bram@vim.org>2016-08-30 23:26:57 +0200
commit89bcfda6834aba724d12554a34b9ed49f5789fd5 (patch)
tree2ffddcadaae9d061e38e17a09b2635ec199eb1dd /runtime/indent/liquid.vim
parent4792255eff03760dca0fd014616532e6d47db364 (diff)
Updated runtime files. Remove version checks for Vim older than 6.0.
Diffstat (limited to 'runtime/indent/liquid.vim')
-rw-r--r--runtime/indent/liquid.vim11
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/indent/liquid.vim b/runtime/indent/liquid.vim
index 01e7223696..f8e1c83079 100644
--- a/runtime/indent/liquid.vim
+++ b/runtime/indent/liquid.vim
@@ -1,7 +1,7 @@
" Vim indent file
" Language: Liquid
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2013 May 30
+" Last Change: 2016 Aug 29
if exists('b:did_indent')
finish
@@ -54,9 +54,10 @@ function! GetLiquidIndent(...)
let line = substitute(line,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','')
let line .= matchstr(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+')
let cline = substitute(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','')
- let ind += &sw * s:count(line,'{%\s*\%(if\|elsif\|else\|unless\|ifchanged\|case\|when\|for\|empty\|tablerow\|capture\)\>')
- let ind -= &sw * s:count(line,'{%\s*end\%(if\|unless\|ifchanged\|case\|for\|tablerow\|capture\)\>')
- let ind -= &sw * s:count(cline,'{%\s*\%(elsif\|else\|when\|empty\)\>')
- let ind -= &sw * s:count(cline,'{%\s*end\w*$')
+ let sw = exists('*shiftwidth') ? shiftwidth() : &sw
+ let ind += sw * s:count(line,'{%\s*\%(if\|elsif\|else\|unless\|ifchanged\|case\|when\|for\|empty\|tablerow\|capture\)\>')
+ let ind -= sw * s:count(line,'{%\s*end\%(if\|unless\|ifchanged\|case\|for\|tablerow\|capture\)\>')
+ let ind -= sw * s:count(cline,'{%\s*\%(elsif\|else\|when\|empty\)\>')
+ let ind -= sw * s:count(cline,'{%\s*end\w*$')
return ind
endfunction