Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rearranged keywords; new 'indentkeys'

  • Loading branch information...
commit 366668622043d48716eb20adb9bd5ae563bb11c2 1 parent 5029357
@tpope tpope authored
Showing with 8 additions and 4 deletions.
  1. +5 −1 ChangeLog
  2. +3 −3 indent/eruby.vim
View
6 ChangeLog
@@ -1,4 +1,8 @@
-2006-11-08 Tim Pope <vim@tpope.info>
+2006-11-08 Tim Pope <vim@tpope.info>
+
+ * indent/eruby.vim: Rearranged keywords; new 'indentkeys'
+
+2006-11-08 Tim Pope <vim@tpope.info>
* indent/eruby.vim: new indenting algorithm
View
6 indent/eruby.vim
@@ -19,7 +19,7 @@ unlet! b:did_indent
let b:did_indent = 1
setlocal indentexpr=GetErubyIndent(v:lnum)
-setlocal indentkeys=o,O,*<Return>,<>>,{,},!^F,=end,=else,=elsif,=rescue,=ensure,=when
+setlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],o,O,!^F,=end,=else,=elsif,=rescue,=ensure,=when
" Only define the function once.
if exists("*GetErubyIndent")
@@ -39,12 +39,12 @@ function! GetErubyIndent(lnum)
let lnum = prevnonblank(a:lnum-1)
let line = getline(lnum)
let cline = getline(a:lnum)
- if cline =~# '<%\s*\%(end\|else\|\%(elsif\|rescue\|ensure\|case\|when\).\{-\}\)\s*-\=%>'
+ if cline =~# '<%\s*\%(end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%(-\=%>\|$\)'
let ind = ind - &sw
endif
if line =~# '\<do\%(\s*|[^|]*|\)\=\s*-\=%>'
let ind = ind + &sw
- elseif line =~# '<%\s*\%(if\|unless\|for\|while\|until\|def\|class\|module\|begin\|else\|elsif\|rescue\|ensure\|when\)\>.*%>'
+ 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*$'
Please sign in to comment.
Something went wrong with that request. Please try again.