Skip to content

Commit b50d820

Browse files
committed
Add testing for re-highlight in font-lock
1 parent 4f54837 commit b50d820

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/haskell-test-utils.el

+9-4
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,16 @@ if all of its characters have syntax and face. See
110110
(with-haskell-test-buffer (or mode #'haskell-mode)
111111
(if (consp lines-or-contents)
112112
(dolist (line lines-or-contents)
113-
(insert line)
114-
(insert "\n"))
115-
(insert lines-or-contents))
113+
(let ((pos (point)))
114+
(insert line "\n")
115+
(save-excursion
116+
;; For some reason font-lock-fontify-region moves the
117+
;; point. I do not think it is guaranteed it should not,
118+
;; but then it might be our fault. Investigate later.
119+
(font-lock-fontify-region pos (point)))))
120+
(insert lines-or-contents)
121+
(font-lock-fontify-buffer))
116122

117-
(font-lock-fontify-buffer)
118123
(goto-char (point-min))
119124
(dolist (prop props)
120125
(cl-destructuring-bind (string syntax face) prop

0 commit comments

Comments
 (0)