[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 8ae42c825e1: ruby-ts-mode: Fix indentation for string_array clo
From: |
Dmitry Gutov |
Subject: |
emacs-29 8ae42c825e1: ruby-ts-mode: Fix indentation for string_array closer |
Date: |
Sat, 23 Dec 2023 21:22:52 -0500 (EST) |
branch: emacs-29
commit 8ae42c825e1e058d3c736837a023bdc2617b85a2
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 8ae42c825e1: ruby-ts-mode: Fix indentation for string_array closer,
Dmitry Gutov <=