Fix args-out-of-range error from hl-todo

Only seen in scala-mode so far.
This commit is contained in:
Henrik Lissner 2020-06-01 05:45:34 -04:00
parent 1c46051fa5
commit c5b561f796
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -22,6 +22,13 @@
;; For things that just gotta go and will soon be gone.
("DEPRECATED" font-lock-doc-face bold)))
(defadvice! +hl-todo-clamp-font-lock-fontify-region-a (orig-fn &rest args)
"Fix an `args-out-of-range' error in some modes."
:around #'hl-todo-mode
(letf! (defun font-lock-fontify-region (beg end &optional loudly)
(funcall font-lock-fontify-region (max beg 1) end loudly))
(apply orig-fn args)))
;; Use a more primitive todo-keyword detection method in major modes that
;; don't use/have a valid syntax table entry for comments.
(add-hook! '(pug-mode-hook haml-mode-hook)