summaryrefslogtreecommitdiff
path: root/runtime/indent/eruby.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-12 21:29:15 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-12 21:29:15 +0200
commitec7944aaf2d5fd67b7bd59a69d6a393424b6c8f8 (patch)
treed578871973ba7c87e0337dbe90b61d75de667100 /runtime/indent/eruby.vim
parentcab465a6d7a7d158c99b04ddc81650b468d82227 (diff)
downloadvim-git-ec7944aaf2d5fd67b7bd59a69d6a393424b6c8f8.tar.gz
Update runtime files.
Diffstat (limited to 'runtime/indent/eruby.vim')
-rw-r--r--runtime/indent/eruby.vim21
1 files changed, 11 insertions, 10 deletions
diff --git a/runtime/indent/eruby.vim b/runtime/indent/eruby.vim
index a4de118cc..80cab7000 100644
--- a/runtime/indent/eruby.vim
+++ b/runtime/indent/eruby.vim
@@ -1,9 +1,7 @@
" Vim indent file
" Language: eRuby
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2010 May 28
-" URL: http://vim-ruby.rubyforge.org
-" Anon CVS: See above site
+" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
if exists("b:did_indent")
@@ -50,29 +48,32 @@ function! GetErubyIndent(...)
call cursor(v:lnum,1)
let inruby = searchpair('<%','','%>','W')
call cursor(v:lnum,vcol)
- if inruby && getline(v:lnum) !~ '^<%\|^\s*-\=%>'
- let ind = GetRubyIndent()
+ if inruby && getline(v:lnum) !~ '^<%\|^\s*[-=]\=%>'
+ let ind = GetRubyIndent(v:lnum)
else
exe "let ind = ".b:eruby_subtype_indentexpr
endif
let lnum = prevnonblank(v:lnum-1)
let line = getline(lnum)
let cline = getline(v:lnum)
- if cline =~# '^\s*<%-\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%(-\=%>\|$\)'
+ if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)'
let ind = ind - &sw
endif
- if line =~# '\S\s*<%-\=\s*\%(}\|end\).\{-\}\s*\%(-\=%>\|$\)'
+ if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)'
let ind = ind - &sw
endif
- if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*-\=%>'
+ if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*[-=]\=%>'
let ind = ind + &sw
- elseif line =~# '<%-\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>'
+ elseif line =~# '<%[-=]\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>'
let ind = ind + &sw
endif
if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>'
let ind = ind + &sw
endif
- if cline =~# '^\s*-\=%>\s*$'
+ if line !~# '^\s*<%' && line =~# '%>\s*$'
+ let ind = ind - &sw
+ endif
+ if cline =~# '^\s*[-=]\=%>\s*$'
let ind = ind - &sw
endif
return ind