[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 819719330a 4/4: (ruby-ts--indent-rules): Add a rule for continu
From: |
Dmitry Gutov |
Subject: |
emacs-29 819719330a 4/4: (ruby-ts--indent-rules): Add a rule for continuation of a hash pair |
Date: |
Wed, 18 Jan 2023 22:28:09 -0500 (EST) |
branch: emacs-29
commit 819719330ad9d1c2836079ef3006c5790fa7f93f
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
(ruby-ts--indent-rules): Add a rule for continuation of a hash pair
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Add a rule for continuation of a hash pair.
* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: Add examples.
---
lisp/progmodes/ruby-ts-mode.el | 2 ++
test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el
index a2b2721dc1..c334c4aff0 100644
--- a/lisp/progmodes/ruby-ts-mode.el
+++ b/lisp/progmodes/ruby-ts-mode.el
@@ -723,6 +723,8 @@ a statement container is a node that matches
((match "]" "array") ruby-ts--parent-call-or-bol 0)
((parent-is "array") ruby-ts--parent-call-or-bol ruby-indent-level)
+ ((parent-is "pair") ruby-ts--parent-call-or-bol 0)
+
((match ")" "parenthesized_statements") parent-bol 0)
((parent-is "parenthesized_statements") parent-bol
ruby-indent-level)
diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb
b/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb
index fa16107c56..4be532a5e9 100644
--- a/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb
+++ b/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb
@@ -79,6 +79,12 @@ foo(a, {
c: d
})
+foo(foo, bar:
+ tee)
+
+foo(foo, :bar =>
+ tee)
+
# Local Variables:
# mode: ruby-ts
# ruby-after-operator-indent: t