From 15ae2d70f30196d08c33eb40639ff52ccc469406 Mon Sep 17 00:00:00 2001 From: Andrew Radev Date: Wed, 8 Aug 2012 13:31:44 +0300 Subject: [PATCH] Handling for multiline splats --- etc/examples/indent/splat.rb | 30 ++++++++++++++++++++++++++++++ indent/ruby.vim | 20 +++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 etc/examples/indent/splat.rb diff --git a/etc/examples/indent/splat.rb b/etc/examples/indent/splat.rb new file mode 100644 index 00000000..8fdb3371 --- /dev/null +++ b/etc/examples/indent/splat.rb @@ -0,0 +1,30 @@ +x = Foo[* + y do + z + end +] + +x = Foo[* # with a comment + y do + z + end +] + +x = * + array.map do + 3 +end + +x = Foo[* + y { + z + } +] + +x = Foo(*y do + z +end) + +foo(1, + 2, + *) diff --git a/indent/ruby.vim b/indent/ruby.vim index 387899c2..f8549da7 100644 --- a/indent/ruby.vim +++ b/indent/ruby.vim @@ -90,6 +90,9 @@ let s:continuation_regex = " Regex that defines bracket continuations let s:bracket_continuation_regex = '%\@