]> git.eshelyaron.com Git - emacs.git/commitdiff
ruby-mode: Recognize instance or global var as first arg in parenless call
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 17 Dec 2022 01:30:52 +0000 (03:30 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 17 Dec 2022 01:31:11 +0000 (03:31 +0200)
* 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.

lisp/progmodes/ruby-mode.el
test/lisp/progmodes/ruby-mode-resources/ruby.rb

index 9a557484b587b463f2b34dc91ff72ed56ad76d31..2b1db5980691492352c0ec3e4fbbdffffe682ab2 100644 (file)
@@ -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.
index f39489071ec75af8626685e7b2503ac18272525b..43f8bebcfc2e54b24e29ff6cfa5e986595226967 100644 (file)
@@ -174,6 +174,9 @@ qux :+,
     bar,
     :a
 
+zzz @abc,
+    4
+
 b = $:
 c = ??