anchor.diff:  
   (defun move-to-next-virtual-line-n (point window n)
     (assert (eq (point-buffer point) (window-buffer window)))
  -  (let ((off-x      (point-charpos point))
  -        (n1         n)
  -        (first-line t))
  -    (when (<= n 0)
  -      (return-from move-to-next-virtual-line-n point))
  -    (unless (variable-value 'truncate-lines :default (point-buffer point))
  -      (return-from move-to-next-virtual-line-n (line-offset point n)))
  -    (loop :do (map-wrapping-line
  -               window
  -               (line-string point)
  -               (lambda (i)
  -                 (when (and first-line
  -                            (<= i (point-charpos point)))
  -                   (setf off-x (- (point-charpos point) i)))
  -                 (when (< (point-charpos point) i)
  -                   (decf n1)
  -                   (when (<= n1 0)
  -                     (line-offset point 0 (+ i off-x))
  -                     (return-from move-to-next-virtual-line-n point)))))
  -              (if (line-offset point 1 off-x)
  -                  (progn
  -                    (setf first-line nil)
  -                    (decf n1)
  -                    (when (<= n1 0)
  -                      (return-from move-to-next-virtual-line-n point)))
  -                  (return-from move-to-next-virtual-line-n nil)))))
  +  (when (<= n 0)
  +    (return-from move-to-next-virtual-line-n point))
  +  (unless (variable-value 'truncate-lines :default (point-buffer point))
  +    (return-from move-to-next-virtual-line-n (line-offset point n)))
  +  (loop :with n1 := n
  +        :do (map-wrapping-line
  +             window
  +             (line-string point)
  +             (lambda (i)
  +               (when (< (point-charpos point) i)
  +                 (decf n1)
  +                 (when (<= n1 0)
  +                   ;; cursor-x offset is recovered by *next-line-prev-column*
  +                   (line-offset point 0 i)
  +                   (return-from move-to-next-virtual-line-n point)))))
  +            ;; go to next line
  +            (unless (line-offset point 1)
  +              (return-from move-to-next-virtual-line-n nil))
  +            (decf n1)
  +            (when (<= n1 0)
  +              (return-from move-to-next-virtual-line-n point))))
   
   (defun move-to-previous-virtual-line-n (point window n)
     (assert (eq (point-buffer point) (window-buffer window)))
  -  (let ((off-x      (point-charpos point))
  -        (n1         n)
  -        (first-line t)
  -        (pos-ring   (make-array (1+ n))) ; ring buffer of wrapping position
  -        (pos-size   (1+ n))
  -        (pos-count  0)
  -        (pos-next   0)
  -        (pos-last   0))
  -    (when (<= n 0)
  -      (return-from move-to-previous-virtual-line-n point))
  -    (unless (variable-value 'truncate-lines :default (point-buffer point))
  -      (return-from move-to-previous-virtual-line-n (line-offset point (- n))))
  +  (when (<= n 0)
  +    (return-from move-to-previous-virtual-line-n point))
  +  (unless (variable-value 'truncate-lines :default (point-buffer point))
  +    (return-from move-to-previous-virtual-line-n (line-offset point (- n))))
  +  (let ((pos-ring  (make-array (1+ n))) ; ring buffer of wrapping position
  +        (pos-size  (1+ n))
  +        (pos-count 0)
  +        (pos-next  0)
  +        (pos-last  0))
       (flet ((pos-ring-push (pos)
                (setf (aref pos-ring pos-next) pos)
                (incf pos-next)
  
positive.code: (defvar *window-id-counter* 0)
  
  (defvar *use-new-vertical-move-function* t)
  
  (defclass window ()
    ((id
  
negative.code:                 (setf cur-x (char-width c 0))))
      (< width (+ cur-x add-x))))
  
  (defun map-wrapping-line (window string fn)
    (let ((lem-base::*tab-size* (variable-value 'tab-width :default (window-buffer window))))
      (loop :with start := 0
  