From: Dmitry Gutov Date: Sun, 24 Dec 2023 02:22:34 +0000 (+0200) Subject: ruby-ts-mode: Fix indentation for string_array closer X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8ae42c825e1e058d3c736837a023bdc2617b85a2;p=emacs.git ruby-ts-mode: Fix indentation for string_array closer * lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules): Fix indentation for string_array closer. --- diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index 843f468e2a1..fc704c5c86a 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -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) diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb b/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb index 4be532a5e9d..8e372de6e45 100644 --- a/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb +++ b/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb @@ -85,6 +85,10 @@ foo(foo, bar: foo(foo, :bar => tee) +foo = %w[ + asd +] + # Local Variables: # mode: ruby-ts # ruby-after-operator-indent: t