FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Attempt to fix incorrect def indentation · vim-ruby/vim-ruby@4d2d7fa · GitHub

Commit 4d2d7fa

Browse files
committed
Attempt to fix incorrect def indentation
1 parent ac9ef4e commit 4d2d7fa

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module Foo
2+
class Bar
3+
f do
4+
g { def h; end }
5+
end
6+
7+
if foo
8+
bar ; end
9+
10+
if bar ; end
11+
12+
foo do
13+
foo = 3 . class
14+
foo = lambda { class One; end }
15+
foo = lambda { |args| class One; end }
16+
foo = bar; class One; end
17+
end
18+
end
19+
end

‎indent/ruby.vim‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ let s:ruby_deindent_keywords =
6363
" Regex that defines the start-match for the 'end' keyword.
6464
"let s:end_start_regex = '\%(^\|[^.]\)\<\%(module\|class\|def\|if\|for\|while\|until\|case\|unless\|begin\|do\)\>'
6565
" TODO: the do here should be restricted somewhat (only at end of line)?
66-
let s:end_start_regex = '^\s*\zs\<\%(module\|class\|def\|if\|for' .
66+
let s:end_start_regex = '\%(^\|[{|;]\)\s*\zs\<\%(module\|class\|def\|if\|for' .
6767
\ '\|while\|until\|case\|unless\|begin\):\@!\>' .
6868
\ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
6969
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' .

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL