branch: elpa/typst-ts-mode commit fa009cdf77aa2be27cef0707d6fe35b38615c62f Author: Huan Nguyen <nguyenthieuh...@gmail.com> Commit: Huan Nguyen <nguyenthieuh...@gmail.com>
fix: #12 - #[ ] - hi #[ hello ] --- typst-ts-mode.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/typst-ts-mode.el b/typst-ts-mode.el index 0f9f1a8edd..75f1a3c8fc 100644 --- a/typst-ts-mode.el +++ b/typst-ts-mode.el @@ -438,6 +438,14 @@ NODE, PARENT and BOL see `treesit-simple-indent-rules'." ((and no-node (parent-is "source_file")) prev-line 0) ((parent-is "source_file") column-0 0) + ((n-p-gp ,(regexp-opt '(")" "]" "}" "$")) + ,typst-ts-mode--container-node-types-regexp + "item") + (lambda (_node parent _bol) + (treesit-node-start + (treesit-node-child (treesit-node-parent parent) 1))) + 0) + ((n-p-gp ,(regexp-opt '(")" "]" "}" "$")) ,typst-ts-mode--container-node-types-regexp nil) @@ -459,7 +467,7 @@ NODE, PARENT and BOL see `treesit-simple-indent-rules'." ;; item - child item ((and (node-is "item") (parent-is "item")) parent-bol typst-ts-mode-indent-offset) - + ;; multi-line item ;; - #[hi] foo ;; bar @@ -467,7 +475,7 @@ NODE, PARENT and BOL see `treesit-simple-indent-rules'." ;; `adaptive-fill-regexp' ((match nil "item" nil 2 nil) typst-ts-mode--indentation-multiline-item-get-anchor 0) - + ;; item - new item content should follow its previous line's indentation ;; level ((and no-node