]> git.eshelyaron.com Git - emacs.git/commitdiff
Eagerly indent first field in tables in 'lua-ts-mode'
authorjohn muhl <jm@pub.pink>
Tue, 13 Feb 2024 00:46:51 +0000 (18:46 -0600)
committerEshel Yaron <me@eshelyaron.com>
Sat, 17 Feb 2024 13:03:17 +0000 (14:03 +0100)
* 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)

(cherry picked from commit 84e4f1259b54442f52183c1ccee72a417e0a2658)

lisp/progmodes/lua-ts-mode.el

index dc2a8fcec1eeca5344fbdd90973da9e8dcf34b3c..c7f5ac50b042245966f302b9cf6560d75bad0471 100644 (file)
@@ -317,6 +317,8 @@ values of OVERRIDE."
           (node-is ")")
           (node-is "}"))
       standalone-parent 0)
+     ((match null "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))