diff options
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r-- | lisp/font-lock.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 4a92069b12..3c1f01d588 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1302,15 +1302,18 @@ This function does 2 things: (point-min)))) (when (< end (point-max)) (setq end - (if (get-text-property end 'font-lock-multiline) - (or (text-property-any end (point-max) - 'font-lock-multiline nil) - (point-max)) + (cond + ((get-text-property end 'font-lock-multiline) + (or (text-property-any end (point-max) + 'font-lock-multiline nil) + (point-max))) + ;; If `end' has been set by the function above, don't corrupt it. + (font-lock-extend-after-change-region-function end) ;; Rounding up to a whole number of lines should include the ;; line right after `end'. Typical case: the first char of ;; the line was deleted. Or a \n was inserted in the middle ;; of a line. - (1+ end)))) + (t (1+ end))))) ;; Finally, pre-enlarge the region to a whole number of lines, to try ;; and anticipate what font-lock-default-fontify-region will do, so as to ;; avoid double-redisplay. |