emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 1c0b90e5f7 2/2: ruby-mode: Recognize instance or global var as


From: Dmitry Gutov
Subject: emacs-29 1c0b90e5f7 2/2: ruby-mode: Recognize instance or global var as first arg in parenless call
Date: Fri, 16 Dec 2022 20:31:29 -0500 (EST)

branch: emacs-29
commit 1c0b90e5f7d74f5814da5c242213842be9f67a05
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    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.
---
 lisp/progmodes/ruby-mode.el                     | 2 +-
 test/lisp/progmodes/ruby-mode-resources/ruby.rb | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 9a557484b5..2b1db59806 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 f39489071e..43f8bebcfc 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 = ??
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]