Open nhmacuk opened 4 years ago
This is a weird bug, sometimes it works if I run it twice, and while debugging sometimes it works like it should. I have not figured out what the problem is yet.
Here is how I fixed it.
(defun ov-highlight-clear ()
"Clear highlight at point."
(interactive)
(when-let (ov (ov-at))
(delete-overlay ov)
(ov-clear (ov-beg (ov-at)) (ov-end (ov-at)))
)
(set-buffer-modified-p t)
(let ((buf (get-buffer "*ov-highlights*")))
(when buf
(with-current-buffer buf
(ov-highlight-refresh-list)))))
Obviously could use some clean up--but it's late and I don't feel like restarting emacs for more testing. Just wanted to put the fix out there.
Hopefully I got the fix right! It seems to work ok for me.
ov-highlight-clear
doesn't clear the highlight at point, not by calling it through M-x, in either insert/normal mode, or through a key bound to the function, or going over every letter of the word and calling the function at every letter( also start/end of the line, and position before and after word). No error messages. All functions in this package seems to work great (see screenshor), includingov-highlight-clear-all
.