[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 ac5516bd7d 3/6: ruby-ts-mode: Fix/change indentation of a conti
From: |
Dmitry Gutov |
Subject: |
emacs-29 ac5516bd7d 3/6: ruby-ts-mode: Fix/change indentation of a continuation method call |
Date: |
Tue, 17 Jan 2023 20:28:43 -0500 (EST) |
branch: emacs-29
commit ac5516bd7d568bbcea4fe46273d4f44c891a71ae
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
ruby-ts-mode: Fix/change indentation of a continuation method call
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Fix/change indentation of a continuation method call.
* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
New examples.
---
lisp/progmodes/ruby-ts-mode.el | 4 ++--
test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb | 13 +++++++++++++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el
index 853c869a31..cbf86544be 100644
--- a/lisp/progmodes/ruby-ts-mode.el
+++ b/lisp/progmodes/ruby-ts-mode.el
@@ -697,9 +697,9 @@ i.e. expr of def foo(args) = expr is returned."
;; 2) With paren, 1st arg on next line
((and (query "(argument_list \"(\" _ @indent)")
(node-is ")"))
- (ruby-ts--bol ruby-ts--grand-parent-node) 0)
+ parent-bol 0)
((query "(argument_list \"(\" _ @indent)")
- (ruby-ts--bol ruby-ts--grand-parent-node) ruby-indent-level)
+ parent-bol ruby-indent-level)
;; 3) No paren, ruby-parenless-call-arguments-indent is t
((and ruby-ts--parenless-call-arguments-indent-p (parent-is
"argument_list"))
first-sibling 0)
diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb
b/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb
index 7de94ceade..1a07ababc4 100644
--- a/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb
+++ b/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb
@@ -28,6 +28,19 @@ else
dog = 99
end
+foo1 =
+ subject.update(
+ 1
+ )
+
+foo2 =
+ subject.
+ update(
+ # Might make sense to indent this to 'subject' instead; but this
+ # style seems more popular.
+ 2
+ )
+
# Local Variables:
# mode: ruby-ts
# End:
- emacs-29 updated (c4f0b6ccea -> 343b9b3dfe), Dmitry Gutov, 2023/01/17
- emacs-29 343b9b3dfe 6/6: ruby-ts-mode: Obey the option ruby-method-call-indent, Dmitry Gutov, 2023/01/17
- emacs-29 045404d1aa 5/6: ruby-ts-mode: Obey the option ruby-after-operator-indent, Dmitry Gutov, 2023/01/17
- emacs-29 9ed9ff4690 1/6: ruby-ts-mode: Fix the rules for hanging arrays and hashes, Dmitry Gutov, 2023/01/17
- emacs-29 5e2e68a0c2 2/6: ruby-ts-mode: Fix indent inside parenthesized_expr and else/end after unless, Dmitry Gutov, 2023/01/17
- emacs-29 ac5516bd7d 3/6: ruby-ts-mode: Fix/change indentation of a continuation method call,
Dmitry Gutov <=
- emacs-29 300ca6ac37 4/6: ruby-ts-mode: Fix indent after operator or conditional, Dmitry Gutov, 2023/01/17