aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann1999-08-25 13:03:22 +0000
committerGerd Moellmann1999-08-25 13:03:22 +0000
commitb342430659beaba798db61676fd03c0777f98631 (patch)
tree7620d4f1295bb31f27ba497969debdcb67f7e438
parent8f8ba18631b197c534f0a417a9bd3081ccb59014 (diff)
downloademacs-b342430659beaba798db61676fd03c0777f98631.tar.gz
emacs-b342430659beaba798db61676fd03c0777f98631.zip
(jit-lock-function): Extend the fontified range
to the beginning of the line containing the range start and the beginning of the line following the range end.
-rw-r--r--lisp/jit-lock.el21
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index d2e94fd69e4..345e46e5295 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -246,7 +246,7 @@ is active."
246 (parse-sexp-lookup-properties font-lock-syntactic-keywords) 246 (parse-sexp-lookup-properties font-lock-syntactic-keywords)
247 (old-syntax-table (syntax-table)) 247 (old-syntax-table (syntax-table))
248 (font-lock-beginning-of-syntax-function nil) 248 (font-lock-beginning-of-syntax-function nil)
249 next) 249 next font-lock-start font-lock-end)
250 (when font-lock-syntax-table 250 (when font-lock-syntax-table
251 (set-syntax-table font-lock-syntax-table)) 251 (set-syntax-table font-lock-syntax-table))
252 (save-excursion 252 (save-excursion
@@ -261,17 +261,20 @@ is active."
261 ;; Determine the end of this chunk. 261 ;; Determine the end of this chunk.
262 (setq next (or (text-property-any start end 'fontified t) 262 (setq next (or (text-property-any start end 'fontified t)
263 end)) 263 end))
264 264
265 ;; Goto to the start of the chunk. Make sure we 265 ;; Decide which range of text should be fontified.
266 ;; start fontifying at the beginning of the line 266 ;; The problem is that START and NEXT may be in the
267 ;; containing the chunk start because font-lock 267 ;; middle of something matched by a font-lock regexp.
268 ;; functions seem to expects this, if I believe 268 ;; Until someone has a better idea, let's start
269 ;; lazy-lock. 269 ;; at the start of the line containing START and
270 ;; stop at the start of the line following NEXT.
271 (goto-char next)
272 (setq font-lock-end (line-beginning-position 2))
270 (goto-char start) 273 (goto-char start)
271 (setq start (line-beginning-position)) 274 (setq font-lock-start (line-beginning-position))
272 275
273 ;; Fontify the chunk, and mark it as fontified. 276 ;; Fontify the chunk, and mark it as fontified.
274 (font-lock-fontify-region start end nil) 277 (font-lock-fontify-region font-lock-start font-lock-end nil)
275 (add-text-properties start next '(fontified t)) 278 (add-text-properties start next '(fontified t))
276 279
277 ;; Find the start of the next chunk, if any. 280 ;; Find the start of the next chunk, if any.