emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 e74ba72a6a3 2/2: ruby-ts-mode: Fix two additional cases with ru


From: Dmitry Gutov
Subject: emacs-29 e74ba72a6a3 2/2: ruby-ts-mode: Fix two additional cases with ruby-method-call-indent=nil
Date: Sat, 21 Jan 2023 21:55:47 -0500 (EST)

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

    ruby-ts-mode: Fix two additional cases with ruby-method-call-indent=nil
    
    * lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
    Fix two additional cases with ruby-method-call-indent=nil.
    
    * test/lisp/progmodes/ruby-mode-resources/ruby-method-call-indent.rb:
    Add examples.
---
 lisp/progmodes/ruby-ts-mode.el                                   | 2 +-
 .../progmodes/ruby-mode-resources/ruby-method-call-indent.rb     | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el
index ac0b5d7c6d4..7e5125453e8 100644
--- a/lisp/progmodes/ruby-ts-mode.el
+++ b/lisp/progmodes/ruby-ts-mode.el
@@ -665,7 +665,7 @@ a statement container is a node that matches
                  (or
                   (match "\\." "call")
                   (query "(call \".\" (identifier) @indent)")))
-            parent 0)
+            (ruby-ts--bol ruby-ts--statement-ancestor) ruby-indent-level)
            ((match "\\." "call") parent ruby-indent-level)
 
            ;; method parameters -- four styles:
diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby-method-call-indent.rb 
b/test/lisp/progmodes/ruby-mode-resources/ruby-method-call-indent.rb
index 1a8285ee919..624a6caafe5 100644
--- a/test/lisp/progmodes/ruby-mode-resources/ruby-method-call-indent.rb
+++ b/test/lisp/progmodes/ruby-mode-resources/ruby-method-call-indent.rb
@@ -1,3 +1,8 @@
+foo = subject
+  .update(
+    1
+  )
+
 foo2 =
   subject.
   update(
@@ -10,6 +15,10 @@ foo3 =
     2
   )
 
+my_array.select { |str| str.size > 5 }
+  .map    { |str| str.downcase }
+
 # Local Variables:
 # ruby-method-call-indent: nil
+# ruby-align-chained-calls: nil
 # End:



reply via email to

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