]> git.eshelyaron.com Git - emacs.git/commitdiff
ruby-ts-mode: Fix two additional cases with ruby-method-call-indent=nil
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 22 Jan 2023 02:55:13 +0000 (04:55 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 22 Jan 2023 02:55:13 +0000 (04:55 +0200)
* 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
test/lisp/progmodes/ruby-mode-resources/ruby-method-call-indent.rb

index ac0b5d7c6d43f6191a226c208b58f26d919c7d6d..7e5125453e84a41bc2f06ad9987df269a74c04d4 100644 (file)
@@ -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:
index 1a8285ee91949fbc2470b987f8bb0e6faaf54bb1..624a6caafe5819ad546694db21a0dc29ae65e456 100644 (file)
@@ -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: