branch: elpa/typst-ts-mode commit f643036cc2908295f2bce3223636110911c3c8c1 Author: Huan Thieu Nguyen <nguyenthieuh...@gmail.com> Commit: Huan Thieu Nguyen <nguyenthieuh...@gmail.com>
fix: having point after last column did not count as item #33 + b + a|< `typst-ts-mode-meta-up` 1. world 2. hello --- typst-ts-editing.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/typst-ts-editing.el b/typst-ts-editing.el index 6247d175b5..02dde90631 100644 --- a/typst-ts-editing.el +++ b/typst-ts-editing.el @@ -60,9 +60,13 @@ Return the heading node when yes otherwise nil." (defun typst-ts-mode-item--at-point-p () "Return item node when point is on item. Otherwise nil." - (treesit-parent-until (treesit-node-at (point)) - (lambda (x) (string= (treesit-node-type x) - "item")))) + (treesit-parent-until + (treesit-node-at + (if (and (eolp) (/= (current-column) 0)) + (1- (point)) + (point))) + (lambda (x) (string= (treesit-node-type x) + "item")))) (defun typst-ts-mode-item--with-siblings () "Return (prev current next numbered-p) items.