comparison runtime/indent/liquid.vim @ 48:67300faee616 v7-3-618

v7-3-618
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 01 Aug 2012 18:08:28 +0900
parents c16898406ff2
children
comparison
equal deleted inserted replaced
47:6c0584ec21b1 48:67300faee616
1 " Vim indent file 1 " Vim indent file
2 " Language: Liquid 2 " Language: Liquid
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> 3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
4 " Last Change: 2010 May 21 4 " Last Change: 2012 May 07
5 5
6 if exists('b:did_indent') 6 if exists('b:did_indent')
7 finish 7 finish
8 endif 8 endif
9 9
52 let line = getline(lnum) 52 let line = getline(lnum)
53 let cline = getline(v:lnum) 53 let cline = getline(v:lnum)
54 let line = substitute(line,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','') 54 let line = substitute(line,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','')
55 let line .= matchstr(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+') 55 let line .= matchstr(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+')
56 let cline = substitute(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','') 56 let cline = substitute(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','')
57 let ind += &sw * s:count(line,'{%\s*\%(if\|elsif\|else\|unless\|ifchanged\|case\|when\|for\|tablerow\|capture\)\>') 57 let ind += &sw * s:count(line,'{%\s*\%(if\|elsif\|else\|unless\|ifchanged\|case\|when\|for\|empty\|tablerow\|capture\)\>')
58 let ind -= &sw * s:count(line,'{%\s*end\%(if\|unless\|ifchanged\|case\|for\|tablerow\|capture\)\>') 58 let ind -= &sw * s:count(line,'{%\s*end\%(if\|unless\|ifchanged\|case\|for\|tablerow\|capture\)\>')
59 let ind += &sw * s:count(line,'{%\s*\%(elsif\|else\|when\|empty\)\>')
60 let ind -= &sw * s:count(cline,'{%\s*\%(elsif\|else\|when\|empty\)\>') 59 let ind -= &sw * s:count(cline,'{%\s*\%(elsif\|else\|when\|empty\)\>')
61 let ind -= &sw * s:count(cline,'{%\s*end\w*$') 60 let ind -= &sw * s:count(cline,'{%\s*end\w*$')
62 return ind 61 return ind
63 endfunction 62 endfunction