From: Dmitry Gutov Date: Sat, 17 Dec 2022 01:30:52 +0000 (+0200) Subject: ruby-mode: Recognize instance or global var as first arg in parenless call X-Git-Tag: emacs-29.0.90~1108 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1c0b90e5f7d74f5814da5c242213842be9f67a05;p=emacs.git ruby-mode: Recognize instance or global var as first arg in parenless call * lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): Recognize instance or global var as first arg in parenless call. * test/lisp/progmodes/ruby-mode-resources/ruby.rb: Add example. --- diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 9a557484b58..2b1db598069 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -468,7 +468,7 @@ This only affects the output of the command `ruby-toggle-block'." "else" "elsif" "do" "end" "and") 'symbols)))) (memq (car (syntax-after pos)) '(7 15)) - (looking-at "[([]\\|[-+!~:]\\(?:\\sw\\|\\s_\\)"))))) + (looking-at "[([]\\|[-+!~:@$]\\(?:\\sw\\|\\s_\\)"))))) (defun ruby-smie--before-method-name () ;; Only need to be accurate when method has keyword name. diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby.rb b/test/lisp/progmodes/ruby-mode-resources/ruby.rb index f39489071ec..43f8bebcfc2 100644 --- a/test/lisp/progmodes/ruby-mode-resources/ruby.rb +++ b/test/lisp/progmodes/ruby-mode-resources/ruby.rb @@ -174,6 +174,9 @@ qux :+, bar, :a +zzz @abc, + 4 + b = $: c = ??