Subject: bug#69088: [PATCH] Eagerly indent first field in tables in lua-ts-mode

From: john muhl <[email-masked]>
Date: Mon, 12 Feb 2024 20:49:05 -0600

Sorry for the duplicate. I thought there had been an error while
sending initially.

>From 94de38c493fdc666cd23718d879aaad08e3e6abb Mon Sep 17 00:00:00 2001
From: john muhl <[email-masked]>
Date: Mon, 12 Feb 2024 18:46:51 -0600
Subject: [PATCH] Eagerly indent first field in tables in lua-ts-mode

* lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules):
Properly indent the first field of a table when it appears on a
line by itself.  (bug#69088)
---
 lisp/progmodes/lua-ts-mode.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
index dc2a8fcec1e..15256cc7903 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -317,6 +317,9 @@ lua-ts--simple-indent-rules
           (node-is ")")
           (node-is "}"))
       standalone-parent 0)
+     ((and (lambda (node &rest _) (null node))
+           (parent-is "table_constructor"))
+      standalone-parent lua-ts-indent-offset)
      ((or (and (parent-is "arguments") lua-ts--first-child-matcher)
           (and (parent-is "parameters") lua-ts--first-child-matcher)
           (and (parent-is "table_constructor") lua-ts--first-child-matcher))
-- 
2.41.0