[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typst-ts-mode eb988ca372 187/246: fix: multiline item inde
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typst-ts-mode eb988ca372 187/246: fix: multiline item indentation issue |
Date: |
Fri, 14 Feb 2025 16:55:20 -0500 (EST) |
branch: elpa/typst-ts-mode
commit eb988ca37207728c5b730720825ca3f79827ea8d
Author: meowking <mr.meowking@tutamail.com>
Commit: meowking <mr.meowking@tutamail.com>
fix: multiline item indentation issue
Closes https://codeberg.org/meow_king/typst-ts-mode/issues/9
---
typst-ts-mode.el | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/typst-ts-mode.el b/typst-ts-mode.el
index 3b85e2e219..4b9c705201 100644
--- a/typst-ts-mode.el
+++ b/typst-ts-mode.el
@@ -503,15 +503,6 @@ 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)
@@ -520,6 +511,12 @@ NODE, PARENT and BOL see `treesit-simple-indent-rules'."
(typst-ts-mode--identation-item-linebreak
typst-ts-mode--indentation-item-linebreak-get-pos
typst-ts-mode-indent-offset)
+ ;; multi-line item
+ ;; - foo
+ ;; bar
+ ((match nil "item" nil 2 nil)
+ typst-ts-mode--indentation-multiline-item-get-anchor 0)
+
;; item - item should follow its previous line item's indentation level
((and no-node
(lambda (node parent &rest _)
@@ -560,6 +557,10 @@ NODE, PARENT and BOL see `treesit-simple-indent-rules'."
(catch-all prev-line 0)))
"Tree-sitter indent rules for `typst-ts-mode'.")
+(defun typst-ts-mode--indentation-multiline-item-get-anchor (_node parent _bol)
+ "Return the start of second child of PARENT."
+ (treesit-node-start (treesit-node-child parent 1)))
+
(defun typst-ts-mode-comment-setup()
"Setup comment related stuffs for `typst-ts-mode'."
- [nongnu] elpa/typst-ts-mode 078b2efbb9 089/246: fix: disable echoing indentation debug information, (continued)
- [nongnu] elpa/typst-ts-mode 078b2efbb9 089/246: fix: disable echoing indentation debug information, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 3d373bba6f 095/246: fix: fix outline recognization error when section indent offset is not nil, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 2d25a0ac3f 097/246: refactor: `typst-ts-mode-insert--item`, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 893430dc14 100/246: merge `develop` branch, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode d8d36ba3e9 110/246: doc: update README.md, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 42c080fa64 122/246: fix(compabiilty): Emacs29 treesit-lparser-list -> typst-ts-utils-parser-list, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode dc45e44e38 153/246: doc: update README, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode d614af3433 163/246: fix: don't add lsp configuration by default to respect user's custom configuration, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 6b54ff7084 175/246: refactor: remove `typst-ts-mode--item-on-line-p` function, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode e2309a468c 191/246: fix: typst-ts-mode-cycle, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode eb988ca372 187/246: fix: multiline item indentation issue,
ELPA Syncer <=
- [nongnu] elpa/typst-ts-mode 78e6ec9921 207/246: fix: #15 heading inserting should still work, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 322b52e3cd 209/246: fix: typst-ts-mode-return delete new added line, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode b1deb2d667 214/246: feat: #16 code for reordering list items, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 619acd01e2 220/246: Merge branch 'feat-16/list-item-reordering' into develop, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode a451dcaa67 223/246: chore, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 131c404ee0 232/246: Bound `C-c C-C` to `typst-ts-compile-and-preview`, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 07c6de2c46 240/246: doc: clarify with comment what this is #33, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode f0e8633147 152/246: add notice for the migration (from sourcehut to codeberg), ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 93f93c85cb 167/246: feat: update raw block language tags, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 0d2b61f320 173/246: feat: make `url` fontification inside `markup-standard` feature, ELPA Syncer, 2025/02/14