summaryrefslogtreecommitdiff
path: root/runtime/indent/ruby.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2007-05-05 17:54:07 +0000
committerBram Moolenaar <Bram@vim.org>2007-05-05 17:54:07 +0000
commit9964e468c0209f6b8286e0b08109817c845a3079 (patch)
tree3c53288cff0d4c2e32169d8eb4cd53cc343ad0bc /runtime/indent/ruby.vim
parentd5ab34bd5ecc748d5502f149c476968e5ec2b7c9 (diff)
downloadvim-git-9964e468c0209f6b8286e0b08109817c845a3079.tar.gz
updated for version 7.1a
Diffstat (limited to 'runtime/indent/ruby.vim')
-rw-r--r--runtime/indent/ruby.vim14
1 files changed, 12 insertions, 2 deletions
diff --git a/runtime/indent/ruby.vim b/runtime/indent/ruby.vim
index 3a2837e04..824635bc5 100644
--- a/runtime/indent/ruby.vim
+++ b/runtime/indent/ruby.vim
@@ -217,7 +217,11 @@ function GetRubyIndent()
call cursor(v:lnum, col)
let bs = strpart('(){}[]', stridx(')}]', line[col - 1]) * 2, 2)
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
- let ind = line[col-1]==')' ? virtcol('.')-1 : indent(s:GetMSL(line('.')))
+ if line[col-1]==')' && col('.') != col('$') - 1
+ let ind = virtcol('.')-1
+ else
+ let ind = indent(s:GetMSL(line('.')))
+ endif
endif
return ind
endif
@@ -274,7 +278,11 @@ function GetRubyIndent()
if line =~ '[[({]'
let counts = s:LineHasOpeningBrackets(lnum)
if counts[0] == '1' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
- return virtcol('.')
+ if col('.') + 1 == col('$')
+ return ind + &sw
+ else
+ return virtcol('.')
+ endif
elseif counts[1] == '1' || counts[2] == '1'
return ind + &sw
else
@@ -361,3 +369,5 @@ endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
+
+" vim:set sw=2 sts=2 ts=8 noet ff=unix: