From 819719330ad9d1c2836079ef3006c5790fa7f93f Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 19 Jan 2023 05:26:03 +0200 Subject: [PATCH] (ruby-ts--indent-rules): Add a rule for continuation of a hash pair * 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 | 2 ++ test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index a2b2721dc1b..c334c4aff0c 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -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) diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb b/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb index fa16107c56e..4be532a5e9d 100644 --- a/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb +++ b/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb @@ -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 -- 2.39.2