Reset hl-todo-mode if already active

This commit is contained in:
Henrik Lissner 2017-09-22 13:13:23 +02:00
parent d600d36675
commit 248ea4c2c7
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -7,8 +7,12 @@
This is useful for major modes that don't use or have a valid syntax-table entry
for comment start/end characters."
(set (make-local-variable 'hl-todo-keywords)
`(((lambda (limit)
'(((lambda (limit)
(let (case-fold-search)
(and (re-search-forward hl-todo-regexp limit t)
(memq 'font-lock-comment-face (doom-enlist (get-text-property (point) 'face)))))
(1 (hl-todo-get-face) t t))))))
(memq 'font-lock-comment-face (doom-enlist (get-text-property (point) 'face))))))
(1 (hl-todo-get-face) t t))))
(when hl-todo-mode
(hl-todo-mode -1)
(hl-todo-mode +1)))