anchor.diff:        (let ((c (schar str i)))
           (cond ((syntax-escape-char-p c)
                  (incf i))
  -              ((let ((pos (syntax-scan-token line i)))
  -                 (when pos (setq i pos))))
  +              ((let ((result (syntax-scan-token line i)))
  +                 (cond
  +                   ((null result) nil)
  +                   ((consp result)
  +                    (destructuring-bind (pos . new-line) result
  +                      (setf line new-line)
  +                      (setf str (line-str line))
  +                      (setf i pos)))
  +                   (t
  +                    (setf i result)))))
                 (t
                  (let ((end (syntax-position-word-end (line-str line) i)))
                    (when (<= i (1- end))
                      (setq i (1- end))))))))
  -    (setf (line-%symbol-lifetimes line) *syntax-symbol-lifetimes*)))
  +    (setf (line-%symbol-lifetimes line) *syntax-symbol-lifetimes*)
  +    line))
  +
  +(defun syntax-scan-lines (buffer start-linum end-linum)
  +  (when (enable-syntax-highlight-p buffer)
  +    (let* ((line (buffer-get-line buffer start-linum))
  +           (prev (line-prev line))
  +           (*syntax-symbol-lifetimes* (and prev (line-%symbol-lifetimes prev)))
  +           (start-point (current-point)))
  +      (setf (current-linum) start-linum)
  +      (beginning-of-line)
  +      (loop :until (or (null line)
  +                       (<= end-linum (current-linum)))
  +            :do (setf line (syntax-scan-line line))
  +            :do (unless (forward-line 1)
  +                  (return))
  +            :do (setf line (line-next line)))
  +      (setf (current-point) start-point))))
   
   (defun %syntax-pos-property (pos property-name)
     (let ((line (buffer-get-line (current-buffer) (current-linum))))
  
positive.code:        (get-bvar :enable-syntax-highlight :buffer buffer)))
  
  (defun syntax-scan-window (window)
    (when (enable-syntax-highlight-p (window-buffer window))
      (with-window-range (start-linum end-linum) window
        (syntax-scan-lines (window-buffer window) start-linum end-linum))))
  
  (defun syntax-scan-lines (buffer start-linum end-linum)
    (when (enable-syntax-highlight-p buffer)
      (let* ((line (buffer-get-line buffer start-linum))
             (prev (line-prev line))
             (*syntax-symbol-lifetimes* (and prev (line-%symbol-lifetimes prev))))
        (do ((line line (line-next line))
             (linum start-linum (1+ linum)))
            ((or (null line)
                 (= linum end-linum)))
          (syntax-scan-line line)))))
  
  (defun syntax-scan-buffer (buffer)
    (when (enable-syntax-highlight-p buffer)
      (map-buffer #'(lambda (line linum)
                      (declare (ignore linum))
                      (syntax-scan-line line))
                  buffer)))
  
  (defun syntax-update-symbol-lifetimes ()
    (setq *syntax-symbol-lifetimes*
          (loop :for (symbol . lifetime) :in *syntax-symbol-lifetimes*
            :when (/= 0 lifetime)
            :collect (cons symbol (1- lifetime)))))
  
  (defun syntax-matched-word (line syntax start end)
    (when (syntax-match-matched-symbol syntax)
      (push (cons (syntax-match-matched-symbol syntax)
                  (syntax-match-symbol-lifetime syntax))
            *syntax-symbol-lifetimes*))
    (when (syntax-match-end-symbol syntax)
      (setq *syntax-symbol-lifetimes*
            (remove (syntax-match-end-symbol syntax)
                    *syntax-symbol-lifetimes*
                    :key #'car)))
    (line-add-property line start end :attribute (syntax-attribute syntax))
    t)
  
  (defun syntax-position-word-end (str start)
    (or (position-if-not #'syntax-symbol-char-p str
  
negative.code: 
  (defun syntax-scan-line-region (line region)
    (when region
      (typecase region
        (syntax-region
         (let ((end (syntax-search-region-end region (line-str line) 0)))
           (cond (end
                  (setf (line-%region line) nil)
                  (line-add-property line 0 end :attribute (syntax-attribute region))
                  end)
                 (t
                  (setf (line-%region line) region)
                  (line-add-property line 0
                                     (1+ (length (line-str line)))
                                     :attribute
                                     (syntax-attribute region))
                  (length (line-str line))))))
        (otherwise
         (line-add-property line 0
                            (1+ (length (line-str line)))
                            :attribute
                            (syntax-attribute region))
         (length (line-str line))))))
  
  (defun syntax-scan-line (line)
    (setf (line-%scan-cached-p line) t)
  