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

    fix: delete list item when there is no text
    
    - 1
    - |< this line should be gone after pressing RETURN
---
 typst-ts-editing.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/typst-ts-editing.el b/typst-ts-editing.el
index e3b992da1d..2626d7f3e0 100644
--- a/typst-ts-editing.el
+++ b/typst-ts-editing.el
@@ -124,11 +124,10 @@ When prefix ARG is non-nil, call global return function."
             ;; on item node end
             ((and (eolp)
                   (setq node 
(typst-ts-core-get-parent-of-node-at-bol-nonwhite))
-                  (equal (treesit-node-type node) "item")
-                  (length= (treesit-node-children node) 2))
+                  (equal (treesit-node-type node) "item"))
              (if (> (treesit-node-child-count node) 1)
                  (typst-ts-mode-insert--item node)
-               ;; no text means delete the item on current line
+               ;; no text means delete the item on current line: (item -) 
instead of (item - (text))
                (beginning-of-line)
                (kill-line)
                (indent-according-to-mode))

Reply via email to