diff options
author | Gerd Moellmann <gerd@gnu.org> | 2000-10-16 13:04:34 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2000-10-16 13:04:34 +0000 |
commit | 7a1e3cece9c0ee9885630209ee56730930364de6 (patch) | |
tree | 80a64864df979d092c6314c4946cc9e762c04b02 /lisp/jit-lock.el | |
parent | 6569c3d3cd110a61af50be1b7bfa833af2debb63 (diff) | |
download | emacs-7a1e3cece9c0ee9885630209ee56730930364de6.tar.gz emacs-7a1e3cece9c0ee9885630209ee56730930364de6.tar.bz2 emacs-7a1e3cece9c0ee9885630209ee56730930364de6.zip |
(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.
Diffstat (limited to 'lisp/jit-lock.el')
-rw-r--r-- | lisp/jit-lock.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index bba9122a9c4..0445d6639f0 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el @@ -420,12 +420,20 @@ will take place when text is fontified stealthily." (when jit-lock-mode (save-excursion (with-buffer-prepared-for-jit-lock + ;; If we're in text that matches a multi-line font-lock pattern, + ;; make sure the whole text will be redisplayed. + (when (get-text-property start 'font-lock-multiline) + (setq start (or (previous-single-property-change + start 'font-lock-multiline) + (point-min)))) + ;; It's important that the `fontified' property be set from the ;; beginning of the line, else font-lock will properly change the ;; text's face, but the display will have been done already and will ;; be inconsistent with the buffer's content. (goto-char start) (setq start (line-beginning-position)) + ;; Make sure we change at least one char (in case of deletions). (setq end (min (max end (1+ start)) (point-max))) ;; Request refontification. |