Mercurial > vim
comparison runtime/indent/haml.vim @ 2202:f7579a31705c vim73
Updated runtime files.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 21 May 2010 12:05:36 +0200 |
parents | 0b796e045c42 |
children | 6de9efd58dc0 |
comparison
equal
deleted
inserted
replaced
2201:4c6b4298852f | 2202:f7579a31705c |
---|---|
1 " Vim indent file | 1 " Vim indent file |
2 " Language: HAML | 2 " Language: Haml |
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.info> | 3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
4 " Last Change: 2007 Dec 16 | 4 " Last Change: 2008 Sep 11 |
5 | 5 |
6 if exists("b:did_indent") | 6 if exists("b:did_indent") |
7 finish | 7 finish |
8 endif | 8 endif |
9 runtime! indent/ruby.vim | 9 runtime! indent/ruby.vim |
42 endif | 42 endif |
43 let increase = indent + &sw | 43 let increase = indent + &sw |
44 if indent == indent(lnum) | 44 if indent == indent(lnum) |
45 let indent = cindent <= indent ? -1 : increase | 45 let indent = cindent <= indent ? -1 : increase |
46 endif | 46 endif |
47 "let indent = indent == indent(lnum) ? -1 : indent | |
48 "let indent = indent > indent(lnum) + &sw ? indent(lnum) + &sw : indent | |
49 | 47 |
50 let group = synIDattr(synID(lnum,lastcol,1),'name') | 48 let group = synIDattr(synID(lnum,lastcol,1),'name') |
51 | 49 |
52 if line =~ '^!!!' | 50 if line =~ '^!!!' |
53 return indent | 51 return indent |
54 elseif line =~ '^/\%(\[[^]]*\]\)\=$' | 52 elseif line =~ '^/\%(\[[^]]*\]\)\=$' |
55 return increase | 53 return increase |
56 elseif line =~ '^:' | 54 elseif group == 'hamlFilter' |
57 return increase | 55 return increase |
58 elseif line =~ '^'.s:tag.'[=~-]\s*\%(\%(if\|else\|elsif\|unless\|case\|when\|while\|until\|for\|begin\|module\|class\|def\)\>\%(.*\<end\>\)\@!\|.*do |[^|]*|\s*$\)' | 56 elseif line =~ '^'.s:tag.'[&!]\=[=~-]\s*\%(\%(if\|else\|elsif\|unless\|case\|when\|while\|until\|for\|begin\|module\|class\|def\)\>\%(.*\<end\>\)\@!\|.*do\%(\s*|[^|]*|\)\=\s*$\)' |
57 return increase | |
58 elseif line =~ '^'.s:tag.'[&!]\=[=~-].*,\s*$' | |
59 return increase | 59 return increase |
60 elseif line == '-#' | 60 elseif line == '-#' |
61 return increase | 61 return increase |
62 elseif group =~? '\v^(hamlSelfCloser)$' || line =~? '^%\v%('.g:haml_self_closing_tags.')>' | 62 elseif group =~? '\v^(hamlSelfCloser)$' || line =~? '^%\v%('.g:haml_self_closing_tags.')>' |
63 return indent | 63 return indent |