Mercurial > emacs
comparison lisp/jit-lock.el @ 32531:2555cdee2fed
(jit-lock-after-change): If we're in text that
matches a multi-line font-lock pattern, make sure the whole text
will be redisplayed.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 16 Oct 2000 13:04:34 +0000 |
parents | af9a6a4187ec |
children | 38b7e156a71f |
comparison
equal
deleted
inserted
replaced
32530:e56c929c9908 | 32531:2555cdee2fed |
---|---|
418 in case the syntax of those lines has changed. Refontification | 418 in case the syntax of those lines has changed. Refontification |
419 will take place when text is fontified stealthily." | 419 will take place when text is fontified stealthily." |
420 (when jit-lock-mode | 420 (when jit-lock-mode |
421 (save-excursion | 421 (save-excursion |
422 (with-buffer-prepared-for-jit-lock | 422 (with-buffer-prepared-for-jit-lock |
423 ;; If we're in text that matches a multi-line font-lock pattern, | |
424 ;; make sure the whole text will be redisplayed. | |
425 (when (get-text-property start 'font-lock-multiline) | |
426 (setq start (or (previous-single-property-change | |
427 start 'font-lock-multiline) | |
428 (point-min)))) | |
429 | |
423 ;; It's important that the `fontified' property be set from the | 430 ;; It's important that the `fontified' property be set from the |
424 ;; beginning of the line, else font-lock will properly change the | 431 ;; beginning of the line, else font-lock will properly change the |
425 ;; text's face, but the display will have been done already and will | 432 ;; text's face, but the display will have been done already and will |
426 ;; be inconsistent with the buffer's content. | 433 ;; be inconsistent with the buffer's content. |
427 (goto-char start) | 434 (goto-char start) |
428 (setq start (line-beginning-position)) | 435 (setq start (line-beginning-position)) |
436 | |
429 ;; Make sure we change at least one char (in case of deletions). | 437 ;; Make sure we change at least one char (in case of deletions). |
430 (setq end (min (max end (1+ start)) (point-max))) | 438 (setq end (min (max end (1+ start)) (point-max))) |
431 ;; Request refontification. | 439 ;; Request refontification. |
432 (put-text-property start end 'fontified nil)) | 440 (put-text-property start end 'fontified nil)) |
433 ;; Mark the change for deferred contextual refontification. | 441 ;; Mark the change for deferred contextual refontification. |