From: Dmitry Gutov Date: Sun, 22 Jan 2023 02:55:13 +0000 (+0200) Subject: ruby-ts-mode: Fix two additional cases with ruby-method-call-indent=nil X-Git-Tag: emacs-29.0.90~629 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e74ba72a6a34221abf47145ecf0ec4fc8cda2555;p=emacs.git 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. --- 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: