emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/treesit-fold 03644fb5fa 341/417: fix(indicators): Rely on


From: ELPA Syncer
Subject: [nongnu] elpa/treesit-fold 03644fb5fa 341/417: fix(indicators): Rely on range itself
Date: Mon, 1 Jul 2024 10:03:02 -0400 (EDT)

branch: elpa/treesit-fold
commit 03644fb5fa5eeb066940f23831503260de367a4c
Author: Jen-Chieh <jcs090218@gmail.com>
Commit: Jen-Chieh <jcs090218@gmail.com>

    fix(indicators): Rely on range itself
---
 ts-fold-util.el | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/ts-fold-util.el b/ts-fold-util.el
index 4f0ef253b6..d40adb2583 100644
--- a/ts-fold-util.el
+++ b/ts-fold-util.el
@@ -25,6 +25,12 @@
 
 ;;; Code:
 
+;;
+;; (@* "Externals" )
+;;
+
+(declare-function ts-fold--get-fold-range "ts-fold.el")
+
 ;;
 ;; (@* "Redisplay" )
 ;;
@@ -172,8 +178,9 @@ See macro `with-selected-window' description for arguments 
WINDOW and BODY."
 Optional arguments WEND and WSTART are the range for caching."
   (when-let* ((wend (or wend (window-end nil t)))
               (wstart (or wstart (window-start)))
-              (start (tsc-node-start-position node))
-              (end (tsc-node-end-position node))
+              (range (ignore-errors (ts-fold--get-fold-range node)))
+              (start (car range))
+              (end (cdr range))
               ((or (and (<= wstart start) (<= end wend))    ; with in range
                    (and (<= wstart end) (<= start wstart))  ; just one above
                    (and (<= wend end) (<= start wend)))))   ; just one below



reply via email to

[Prev in Thread] Current Thread [Next in Thread]