]> git.eshelyaron.com Git - emacs.git/commitdiff
(ruby-ts--indent-rules): Add a rule for continuation of a hash pair
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 19 Jan 2023 03:26:03 +0000 (05:26 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 19 Jan 2023 03:27:43 +0000 (05:27 +0200)
* 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
test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb

index a2b2721dc1b63b603591483d191d58ce520b4f7f..c334c4aff0c9c64888744f3ba7f6a07b16ff41fa 100644 (file)
@@ -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)
 
index fa16107c56eb933c9cd3928b31a19391238b78b0..4be532a5e9d5ff6e8e19d528cd1d95044fd01767 100644 (file)
@@ -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