branch: elpa/typst-ts-mode
commit 3159bf6d42dfd7023d3eab7372d281b25717b3f3
Author: Huan Nguyen <nguyenthieuh...@gmail.com>
Commit: Huan Nguyen <nguyenthieuh...@gmail.com>

    feat: indent rule for multi-line item
---
 typst-ts-mode.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/typst-ts-mode.el b/typst-ts-mode.el
index f386fbc509..e12f65b8e8 100644
--- a/typst-ts-mode.el
+++ b/typst-ts-mode.el
@@ -506,6 +506,16 @@ NODE, PARENT and BOL see `treesit-simple-indent-rules'."
      ;;   .split(" ")
      ((n-p-gp "." "field" nil) parent-bol typst-ts-mode-indent-offset)
 
+     ;; multi-line item
+     ;; - foo
+     ;;   bar
+     ((and (parent-is "item")
+           (lambda (node &rest parent bol)
+             (treesit-node-prev-sibling node)))
+      (lambda (node &rest parent bol)
+        (treesit-node-start (treesit-node-prev-sibling node)))
+      0)
+
      ;; item - child item
      ((and (node-is "item") (parent-is "item")) parent-bol 
typst-ts-mode-indent-offset)
 

Reply via email to