Skip to content

Commit

Permalink
feat: Extract render delay variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jul 7, 2024
1 parent 2a0210d commit c773663
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ts-fold-indicators.el
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
:type 'hook
:group 'ts-fold)

(defcustom ts-fold-indicators-render-delay 0.1
"Seconds before rendering indicators."
:type 'float
:group 'ts-fold)

(fringe-helper-define 'ts-fold-indicators-fr-plus nil
"XXXXXXX"
"X.....X"
Expand Down Expand Up @@ -308,8 +313,10 @@ Argument FOLDED holds folding state; it's a boolean."
(let ((timer (window-parameter window 'ts-fold-indicators-render-timer)))
(when (timerp timer)
(cancel-timer timer))
(set-window-parameter window 'ts-fold-indicators-render-timer
(run-with-timer 0.0 nil #'ts-fold-indicators-refresh window))))
(set-window-parameter
window 'ts-fold-indicators-render-timer
(run-with-idle-timer ts-fold-indicators-render-delay
nil #'ts-fold-indicators-refresh window))))

(defun ts-fold-indicators--size-change (&optional frame &rest _)
"Render indicators for all visible windows from FRAME."
Expand Down

0 comments on commit c773663

Please sign in to comment.