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

Allow endless def without brackets · vim-ruby/vim-ruby@910bc7e · GitHub

Commit 910bc7e

Browse files
committed
Allow endless def without brackets
1 parent c8debfc commit 910bc7e

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎indent/ruby.vim‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ let s:ruby_indent_keywords =
9090
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>'
9191

9292
" Def without an end clause: def method_call(...) = <expression>
93-
let s:ruby_endless_def = '\<def\s\+\k\+[!?]\=(.*)\s*='
93+
let s:ruby_endless_def = '\<def\s\+\k\+[!?]\=\%((.*)\|\s\)\s*='
9494

9595
" Regex used for words that, at the start of a line, remove a level of indent.
9696
let s:ruby_deindent_keywords =

‎spec/indent/method_definitions_spec.rb‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ def foo(bar)=puts(bar)
4949
5050
def foo(bar) = bar + 1
5151
52+
def foo() = 1 + 1
53+
def foo = 1 + 1
54+
5255
private def foo(bar) = bar + 1
5356
5457
def foo(bar) =

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL