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

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

[elpa] externals/minuet 8b9ea6ff1c 08/97: fix: use idle timer and fix bu


From: ELPA Syncer
Subject: [elpa] externals/minuet 8b9ea6ff1c 08/97: fix: use idle timer and fix buffer changing check for auto-suggestion.
Date: Mon, 24 Mar 2025 18:59:10 -0400 (EDT)

branch: externals/minuet
commit 8b9ea6ff1cb05840bee7daf31a95d4a3ad105537
Author: Milan Glacier <dev@milanglacier.com>
Commit: Milan Glacier <dev@milanglacier.com>

    fix: use idle timer and fix buffer changing check for auto-suggestion.
---
 minuet.el | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/minuet.el b/minuet.el
index 9d6e79a0f9..79253c578d 100644
--- a/minuet.el
+++ b/minuet.el
@@ -988,16 +988,17 @@ to be called when completion items arrive."
         (when minuet--debounce-timer
             (cancel-timer minuet--debounce-timer))
         (setq minuet--debounce-timer
-              (run-with-timer
-               minuet-auto-suggestion-debounce-delay nil
-               (lambda ()
-                   (when (and (eq (window-buffer (selected-window)) 
(current-buffer))
-                              (or (null minuet--auto-last-point)
-                                  (not (eq minuet--auto-last-point (point))))
-                              (not (run-hook-with-args-until-success 
'minuet-auto-suggestion-block-functions)))
-                       (setq minuet--last-auto-suggestion-time (current-time)
-                             minuet--auto-last-point (point))
-                       (minuet-show-suggestion)))))))
+              (let ((buffer (current-buffer)))
+                  (run-with-idle-timer
+                   minuet-auto-suggestion-debounce-delay nil
+                   (lambda ()
+                       (when (and (eq buffer (current-buffer))
+                                  (or (null minuet--auto-last-point)
+                                      (not (eq minuet--auto-last-point 
(point))))
+                                  (not (run-hook-with-args-until-success 
'minuet-auto-suggestion-block-functions)))
+                           (setq minuet--last-auto-suggestion-time 
(current-time)
+                                 minuet--auto-last-point (point))
+                           (minuet-show-suggestion))))))))
 
 (defun minuet--cleanup-auto-suggestion ()
     "Clean up auto-suggestion timers and hooks."



reply via email to

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