[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars 06c9d7e380 274/431: TS scope update: use id
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars 06c9d7e380 274/431: TS scope update: use idle-timer instead |
Date: |
Mon, 16 Sep 2024 12:59:38 -0400 (EDT) |
branch: externals/indent-bars
commit 06c9d7e380987eb1f9ecec3c87cf5d8717527895
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
TS scope update: use idle-timer instead
---
indent-bars-ts.el | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/indent-bars-ts.el b/indent-bars-ts.el
index 4d5c07739e..e0cddf86c7 100644
--- a/indent-bars-ts.el
+++ b/indent-bars-ts.el
@@ -300,6 +300,7 @@ both) of them cover."
l)))
l))
+(defvar indent-bars-ts--scope-timer nil)
(defun indent-bars-ts--update-scope1 ()
"Perform the treesitter scope font-lock update.
If the buffer is modified or the point has moved, re-query the
@@ -308,7 +309,8 @@ the window's bounds, falls outside the prior scope (beyond
normal
marker movement), refontify the union of old and new clipped
ranges and update. Note that the updated node range clips to an
\"extended window\" with 50% padding on either side."
- (unless (or (not ibtcs) ; can be called from other buffers!
+ (setq indent-bars-ts--scope-timer nil)
+ (unless (or (not ibtcs) ; can be called from other buffers!
(and (= (point) (ibts/point ibtcs))
(= (buffer-modified-tick) (ibts/tick ibtcs))))
(when-let ((node (treesit-node-on
@@ -340,17 +342,12 @@ ranges and update. Note that the updated node range
clips to an
(set-marker (funcall fn (ibts/clip-win ibtcs))
(funcall fn clip-wide)))))))))
-(defvar indent-bars-ts--scope-timer nil)
(defun indent-bars-ts--update-scope ()
"Update treesit scope when possible."
- (if-let ((tmr indent-bars-ts--scope-timer))
- (progn ; reschedule timer
- (timer-set-time
- tmr (time-add (current-time) indent-bars-ts-update-delay))
- (unless (memq tmr timer-list) (timer-activate tmr)))
+ (unless indent-bars-ts--scope-timer
(setq indent-bars-ts--scope-timer
- (run-with-timer indent-bars-ts-update-delay nil
- #'indent-bars-ts--update-scope1))))
+ (run-with-idle-timer indent-bars-ts-update-delay nil
+ #'indent-bars-ts--update-scope1))))
;;;; Setup
(defun indent-bars-ts--init-scope (&optional force)
@@ -366,6 +363,9 @@ performed."
(defun indent-bars-ts--teardown ()
"Teardown indent-bars-ts."
+ (when indent-bars-ts--scope-timer
+ (cancel-timer indent-bars-ts--scope-timer)
+ (setq indent-bars-ts--scope-timer nil))
(setq
indent-bars--display-form nil
indent-bars--handle-blank-lines-form nil)
- [elpa] externals/indent-bars db7d4ba51d 388/431: Protect against custom-set reentry, (continued)
- [elpa] externals/indent-bars db7d4ba51d 388/431: Protect against custom-set reentry, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 79c21f2999 429/431: Assign copyright to FSF, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 9fc2e57d38 420/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 852c12b1fe 430/431: README: mention ELPA, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 2d1d854dda 393/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars c02ded1991 406/431: Bump version, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 51f12b7c06 215/431: Correct depth calculation (again), ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 29d32e5718 241/431: Make style variables global and move remaps to buffer-local vars, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars fb1a0d6d1a 239/431: Merge pull request #39 from oxcl/main, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 5c06a2d47a 252/431: re-organize requires, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 06c9d7e380 274/431: TS scope update: use idle-timer instead,
ELPA Syncer <=
- [elpa] externals/indent-bars 0d684be9eb 290/431: docs: custom vars doc improvmements, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 8787ebc872 300/431: Increase default TS out-of-scope color blend factor to 0.15, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 7c8d680619 348/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 29005e1bd0 317/431: Increase default color blend to 0.5, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 1a851b6503 345/431: remove ts-teardown hook function on teardown, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars c12c740153 346/431: Bump version, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 0af707c007 338/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars af02883218 374/431: README improvements, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars f486b9a4c8 350/431: README: cleanup links, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars cbe88d5c7a 379/431: README: fix stray empty item, ELPA Syncer, 2024/09/16