diff --git a/wip-duuqnd/editor/editor.lisp b/wip-duuqnd/editor/editor.lisp index dfe9738..a81bce4 100644 --- a/wip-duuqnd/editor/editor.lisp +++ b/wip-duuqnd/editor/editor.lisp @@ -318,7 +318,7 @@ serial connection the editor normally runs under.") :start1 (1+ column)) (setf (char (line-content line) column) character)))) (when (line-in-view line (current-view *editor*)) - (redisplay-line line :start column))) + (redisplay-line line :start column :addingp t))) (defmethod delete-character-in-line ((line line) column) (unless (< column (fill-pointer (line-content line))) @@ -368,12 +368,12 @@ serial connection the editor normally runs under.") (cursor-column (cursor *editor*)) start) (update-buffer-cursor (current-buffer *editor*)))))) -(defmethod redisplay-line ((line line) &key (start 0)) +(defmethod redisplay-line ((line line) &key (start 0) addingp) ;; TODO: save the cursor position (with-editor-accessors *editor* (:current-line current :current-buffer buffer) (cond - ((= start (1- (line-length line))) + ((and addingp (= start (1- (line-length line)))) (let ((char-pos (1- (fill-pointer (line-content line))))) (move-cursor (view-line-number (buffer-view buffer) line) char-pos) (write-char (aref (line-content line) char-pos) *eio*)