branch: elpa/typst-ts-mode
commit 4a9a79db64f4790118d82a5a8eeac91c2c4b42fd
Author: meowking <mr.meowk...@tutamail.com>
Commit: meowking <mr.meowk...@tutamail.com>

    chore
---
 typst-ts-core.el    | 3 +--
 typst-ts-editing.el | 7 ++++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/typst-ts-core.el b/typst-ts-core.el
index b89c16b8e1..02122fa4b0 100644
--- a/typst-ts-core.el
+++ b/typst-ts-core.el
@@ -45,7 +45,7 @@
     (back-to-indentation)
     (point)))
 
-(defun typst-ts-core-line-bol-pos (&optional pos)
+(defun typst-ts-core-line-bol-nonwhite-pos (&optional pos)
   "POS."
   (save-excursion
     (when pos
@@ -102,7 +102,6 @@ TYPES is an regexp expression."
          (prev-node-type (treesit-node-type prev-node)))
     (while (and prev-node-type
                 (string-match-p types prev-node-type))
-      (message "%s" prev-node)
       (setq
        prev-node (treesit-node-prev-sibling prev-node)
        prev-node-type (treesit-node-type prev-node)))
diff --git a/typst-ts-editing.el b/typst-ts-editing.el
index 8c6cdda2dc..c1fad3c3be 100644
--- a/typst-ts-editing.el
+++ b/typst-ts-editing.el
@@ -217,7 +217,7 @@ When there is no section it will insert a heading below 
point."
 (defun typst-ts-editing--indent-item-node-lines (node offset)
   (let ((item-node-min-column
          (typst-ts-core-column-at-pos
-          (typst-ts-core-line-bol-pos
+          (typst-ts-core-line-bol-nonwhite-pos
            (treesit-node-start node)))))
     (if (< (+ item-node-min-column offset) 0)
         (setq offset (- item-node-min-column)))
@@ -226,7 +226,7 @@ When there is no section it will insert a heading below 
point."
      (lambda ()
        (indent-line-to
         (+ (typst-ts-core-column-at-pos
-            (typst-ts-core-line-bol-pos))
+            (typst-ts-core-line-bol-nonwhite-pos))
            offset))))))
 
 (defun typst-ts-mode-cycle (&optional _arg)
@@ -294,7 +294,8 @@ When there is no section it will insert a heading below 
point."
                  (typst-ts-editing--indent-item-node-lines
                   cur-item-node
                   (- typst-ts-mode-indent-offset (abs offset)))))
-             ))
+
+             (throw 'execute-result 'success)))
           
           (t nil)))))
     ;; execute default action if not successful

Reply via email to