]> git.eshelyaron.com Git - emacs.git/commitdiff
ruby-ts-mode: Fix indentation for string_array closer
authorDmitry Gutov <dmitry@gutov.dev>
Sun, 24 Dec 2023 02:22:34 +0000 (04:22 +0200)
committerDmitry Gutov <dmitry@gutov.dev>
Sun, 24 Dec 2023 02:22:34 +0000 (04:22 +0200)
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules):
Fix indentation for string_array closer.

lisp/progmodes/ruby-ts-mode.el
test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb

index 843f468e2a16bef23c1bd380bf5e50bbe74d6406..fc704c5c86a676875c3ce587145aff71cfb15956 100644 (file)
@@ -753,8 +753,9 @@ a statement container is a node that matches
 
            ((match "}" "hash")  ruby-ts--parent-call-or-bol 0)
            ((parent-is "hash")  ruby-ts--parent-call-or-bol ruby-indent-level)
-           ((match "]" "array") ruby-ts--parent-call-or-bol 0)
-           ((parent-is "array") ruby-ts--parent-call-or-bol ruby-indent-level)
+           ((match "]" "^array") ruby-ts--parent-call-or-bol 0)
+           ((parent-is "^array") ruby-ts--parent-call-or-bol ruby-indent-level)
+           ((match ")" "string_array") ruby-ts--parent-call-or-bol 0)
 
            ((parent-is "pair") ruby-ts--parent-call-or-bol 0)
 
index 4be532a5e9d5ff6e8e19d528cd1d95044fd01767..8e372de6e456e30cc199d7b3638857d7ce679db9 100644 (file)
@@ -85,6 +85,10 @@ foo(foo, bar:
 foo(foo, :bar =>
     tee)
 
+foo = %w[
+  asd
+]
+
 # Local Variables:
 # mode: ruby-ts
 # ruby-after-operator-indent: t