Skip to content

Commit

Permalink
fix: Allow error in continuous node
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jun 23, 2024
1 parent af3a57b commit 675e5e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions treesit-fold.el
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,10 @@ more information.
Argument PREFIX is the comment prefix in string."
(save-excursion
(when-let* ((treesit-fold-line-comment-mode) ; XXX: Check enabled!?
(first-node (treesit-fold--continuous-node-prefix node prefix nil))
(last-node (treesit-fold--continuous-node-prefix node prefix t))
(first-node (ignore-errors
(treesit-fold--continuous-node-prefix node prefix nil)))
(last-node (ignore-errors
(treesit-fold--continuous-node-prefix node prefix t)))
(prefix-len (length prefix))
(beg (+ (treesit-node-start first-node) prefix-len))
(end (treesit-node-end last-node)))
Expand Down

0 comments on commit 675e5e7

Please sign in to comment.