anchor.diff:          (ffi-window-set-minibuffer-height (current-window) 0))))
   
   (defun insert (characters &optional (minibuffer (current-minibuffer)))
  -  (setf (input-buffer minibuffer)
  -        (str:insert characters
  -                    (input-cursor-position minibuffer)
  -                    (input-buffer minibuffer)))
  -  (incf (input-cursor-position minibuffer) (length characters))
  +  ;; Set cursor before buffer to ensure cursor is never higher than buffer length.
  +  (let ((old-cursor-position (input-cursor-position minibuffer)))
  +    (incf (input-cursor-position minibuffer) (length characters))
  +    (setf (input-buffer minibuffer)
  +          (str:insert characters
  +                      old-cursor-position
  +                      (input-buffer minibuffer))))
     (state-changed minibuffer)
     (update-display minibuffer))
   
  
positive.code:   (with-accessors ((buffer input-buffer) (cursor input-cursor-position)) minibuffer
      (let* ((current-cursor-position cursor)
             (new-cursor-position (cursor-forwards-word minibuffer))
             (transpose-distance (- new-cursor-position current-cursor-position)))
        (setf buffer
              (concatenate 'string
                           (subseq buffer 0 current-cursor-position)
                           (subseq buffer new-cursor-position (length buffer))))
        (setf cursor (- cursor transpose-distance))))
    (state-changed minibuffer)
    (update-display minibuffer))
  
  
negative.code: (define-command kill-whole-line (&optional (minibuffer (current-minibuffer)))
    "Delete all characters in the input."
    (with-accessors ((buffer input-buffer) (cursor input-cursor-position)) minibuffer
      ;; Set cursor before buffer to ensure cursor is never higher than buffer length.
      (setf cursor 0
            buffer ""))
    (state-changed minibuffer)
    (update-display minibuffer))
  
  