From 8ae42c825e1e058d3c736837a023bdc2617b85a2 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sun, 24 Dec 2023 04:22:34 +0200 Subject: [PATCH] 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. --- lisp/progmodes/ruby-ts-mode.el | 5 +++-- test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) 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 -- 2.39.5