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

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

[nongnu] elpa/treesit-fold bb11d49dfe 054/417: wip


From: ELPA Syncer
Subject: [nongnu] elpa/treesit-fold bb11d49dfe 054/417: wip
Date: Mon, 1 Jul 2024 10:02:10 -0400 (EDT)

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

    wip
---
 tree-sitter-fold.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tree-sitter-fold.el b/tree-sitter-fold.el
index 3c05a258b0..cc4947e843 100644
--- a/tree-sitter-fold.el
+++ b/tree-sitter-fold.el
@@ -42,6 +42,7 @@
 (require 'subr-x)
 
 (require 'tree-sitter)
+(require 'tree-sitter-fold-summary)
 
 ;;
 ;; (@* "Customization" )
@@ -190,9 +191,11 @@ This function is borrowed from 
`tree-sitter-node-at-point'."
 (defun tree-sitter-fold--create-overlay (range)
   "Create invisible overlay in RANGE."
   (when (not (null range))
-    (let ((ov (make-overlay (car range) (cdr range))))
+    (let* ((beg (car range)) (end (cdr range)) (ov (make-overlay beg end)))
       (overlay-put ov 'invisible 'tree-sitter-fold)
-      (overlay-put ov 'display tree-sitter-fold-replacement)
+      (overlay-put ov 'display (or (and tree-sitter-fold-show-summary
+                                        (tree-sitter-fold--get-summary 
(buffer-substring beg end)))
+                                   tree-sitter-fold-replacement))
       (overlay-put ov 'face 'tree-sitter-fold-replacement-face)
       (overlay-put ov 'isearch-open-invisible 
#'tree-sitter-fold--isearch-open))))
 



reply via email to

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