From a8370b125e41d66a8aacc139a9f670e9717f1ecf Mon Sep 17 00:00:00 2001 From: Genadi Samokovarov Date: Sun, 18 Aug 2024 22:11:36 +0300 Subject: [PATCH] Fix joining single line Ruby methods without arguments Joining single-line Ruby method _without_ arguments into an endless method definition was not working as the regexp pattern expected the `def` always to accept parenthesized arguments. Example: ```ruby def foo() bar end ``` Would be joined to: ```ruby def foo() = bar ``` However, the following, which is the idiomatic way to write Ruby methods without arguments, would not: ```ruby def foo bar end ``` --- autoload/sj/ruby.vim | 2 +- spec/plugin/ruby_spec.rb | 42 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/autoload/sj/ruby.vim b/autoload/sj/ruby.vim index 4afc004a..f3b630ca 100644 --- a/autoload/sj/ruby.vim +++ b/autoload/sj/ruby.vim @@ -1113,7 +1113,7 @@ endfunction function! sj#ruby#JoinOnelineDef() " adapted from vim-ruby - if search('\