Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add experimental/lisp-toggle-highlight command
Browse files Browse the repository at this point in the history
cxxxr committed Nov 20, 2023
1 parent da72256 commit 9b64323
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions extensions/lisp-mode/highlight.lisp
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
(:use :cl :lem :lem-lisp-mode/internal))
(in-package :lem-lisp-mode/highlight)

(defvar *timer*)
(defvar *timer* nil)

(define-attribute highlight-attribute
(t :underline t :foreground "cyan"))
@@ -60,7 +60,8 @@
(highlight-symbol point)))))))))

(defun init-highlight-timer ()
(let ((timer (make-idle-timer 'lisp-highlight :name "lisp-show"
(let ((timer (make-idle-timer 'lisp-highlight
:name "lisp-highlight"
:handle-function 'stop-highlight-timer)))
(setf *timer* timer)
(start-timer timer 100 t)))
@@ -69,3 +70,8 @@
(when *timer*
(stop-timer *timer*)
(setf *timer* nil)))

(define-command experimental/lisp-toggle-highlight () ()
(if *timer*
(stop-highlight-timer)
(init-highlight-timer)))

0 comments on commit 9b64323

Please sign in to comment.