diff options
| author | Adam Stankiewicz <sheerun@sher.pl> | 2016-05-02 10:42:37 +0200 | 
|---|---|---|
| committer | Adam Stankiewicz <sheerun@sher.pl> | 2016-05-02 10:42:37 +0200 | 
| commit | 5dd1a7e83966c92d220073185f1738dfe441f59e (patch) | |
| tree | 9c4bee389a51a9bb111dcc894c9db0f6d1809d81 /indent/blade.vim | |
| parent | bc098370c1bb81840734f5764f431dee270e75ce (diff) | |
| download | vim-polyglot-5dd1a7e83966c92d220073185f1738dfe441f59e.tar.gz vim-polyglot-5dd1a7e83966c92d220073185f1738dfe441f59e.zip  | |
Update
Diffstat (limited to 'indent/blade.vim')
| -rw-r--r-- | indent/blade.vim | 21 | 
1 files changed, 15 insertions, 6 deletions
diff --git a/indent/blade.vim b/indent/blade.vim index 78a8a78c..4c89ed61 100644 --- a/indent/blade.vim +++ b/indent/blade.vim @@ -13,7 +13,7 @@ let b:did_indent = 1  setlocal autoindent  setlocal indentexpr=GetBladeIndent() -setlocal indentkeys=o,O,*<Return>,<>>,!^F,=@else,=@end,=@empty +setlocal indentkeys=o,O,*<Return>,<>>,!^F,=@else,=@end,=@empty,=@show  " Only define the function once.  if exists("*GetBladeIndent") @@ -30,17 +30,26 @@ function! GetBladeIndent()      let cline = substitute(substitute(getline(v:lnum), '\s\+$', '', ''), '^\s\+', '', '')      let indent = indent(lnum)      let cindent = indent(v:lnum) -    if cline =~# '@\%(else\|elseif\|empty\|end\)' -        let indent = cindent < indent ? cindent : indent - &sw -    elseif HtmlIndent() > -1 -        let indent = HtmlIndent() +    if cline =~# '@\%(else\|elseif\|empty\|end\|show\)' +        let indent = indent - &sw +    else +        if exists("*GetBladeIndentCustom") +            let hindent = GetBladeIndentCustom() +        else +            let hindent = HtmlIndent() +        endif +        if hindent > -1 +            let indent = hindent +        endif      endif      let increase = indent + &sw      if indent = indent(lnum)          let indent = cindent <= indent ? -1 : increase      endif -    if line =~# '@\%(if\|elseif\|else\|unless\|foreach\|forelse\|for\|while\)\%(.*\s*@end\)\@!' +    if line =~# '@\%(section\)\%(.*\s*@end\)\@!' && line !~# '@\%(section\)\s*([^,]*)' +        return indent +    elseif line =~# '@\%(if\|elseif\|else\|unless\|foreach\|forelse\|for\|while\|empty\|push\|section\|can\)\%(.*\s*@end\)\@!'          return increase      else          return indent  | 
