diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-05-28 20:54:39 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-05-28 20:54:39 +0200 |
commit | 1d68952a3eeb40efc5568d99d0b2dd37960975e7 (patch) | |
tree | 59c8eda2101b9544bb48b8c690ef5e1d4fcbb21a /runtime/indent | |
parent | 167632fcddd32656a737fa5568504fff12d04f70 (diff) |
Runtime file updates.
Diffstat (limited to 'runtime/indent')
-rw-r--r-- | runtime/indent/eruby.vim | 9 | ||||
-rw-r--r-- | runtime/indent/ruby.vim | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/runtime/indent/eruby.vim b/runtime/indent/eruby.vim index 931eaac385..a4de118ccf 100644 --- a/runtime/indent/eruby.vim +++ b/runtime/indent/eruby.vim @@ -1,7 +1,7 @@ " Vim indent file " Language: eRuby -" Maintainer: Tim Pope <vimNOSPAM@tpope.info> -" Info: $Id: eruby.vim,v 1.16 2008/06/29 04:18:43 tpope Exp $ +" Maintainer: Tim Pope <vimNOSPAM@tpope.org> +" Last Change: 2010 May 28 " URL: http://vim-ruby.rubyforge.org " Anon CVS: See above site " Release Coordinator: Doug Kearns <dougkearns@gmail.com> @@ -58,7 +58,10 @@ function! GetErubyIndent(...) let lnum = prevnonblank(v:lnum-1) let line = getline(lnum) let cline = getline(v:lnum) - if cline =~# '<%-\=\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*\%(-\=%>\|$\)' let ind = ind - &sw endif if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*-\=%>' diff --git a/runtime/indent/ruby.vim b/runtime/indent/ruby.vim index 4a3012f94f..04d130104d 100644 --- a/runtime/indent/ruby.vim +++ b/runtime/indent/ruby.vim @@ -1,7 +1,7 @@ " Vim indent file " Language: Ruby " Maintainer: Nikolai Weibull <now at bitwi.se> -" Info: $Id: ruby.vim,v 1.47 2008/06/29 04:18:43 tpope Exp $ +" Last Change: 2009 Dec 17 " URL: http://vim-ruby.rubyforge.org " Anon CVS: See above site " Release Coordinator: Doug Kearns <dougkearns@gmail.com> @@ -178,7 +178,7 @@ function s:LineHasOpeningBrackets(lnum) endfunction function s:Match(lnum, regex) - let col = match(getline(a:lnum), a:regex) + 1 + let col = match(getline(a:lnum), '\C'.a:regex) + 1 return col > 0 && !s:IsInStringOrComment(a:lnum, col) ? col : 0 endfunction |