I think I fixed the command history

This commit is contained in:
eknauel 2005-05-31 12:39:57 +00:00
parent ccd32b461f
commit c48ea3b152
1 changed files with 5 additions and 3 deletions

View File

@ -67,7 +67,9 @@
(pos-col . ,buffer-pos-col) (pos-col . ,buffer-pos-col)
(pos-fin-ln . ,buffer-pos-fin-ln) (pos-fin-ln . ,buffer-pos-fin-ln)
(pos-y . ,buffer-pos-y) (pos-y . ,buffer-pos-y)
(pos-x . ,buffer-pos-x)))))) (pos-x . ,buffer-pos-x)
(history-pos . ,buffer-history-pos)
(lines . ,(lambda (b) (length (buffer-text b)))))))))
(define (buffer-text-current-line buffer) (define (buffer-text-current-line buffer)
(list-ref (buffer-text buffer) (list-ref (buffer-text buffer)
@ -85,12 +87,12 @@
;; enter key ;; enter key
((= ch 10) ((= ch 10)
(set-buffer-text! buffer (set-buffer-text! buffer
(append (buffer-text buffer (list "")))) (append (buffer-text buffer) (list "")))
(set-buffer-pos-line! buffer (set-buffer-pos-line! buffer
(+ (buffer-pos-line buffer) 1)) (+ (buffer-pos-line buffer) 1))
(set-buffer-pos-col! buffer first-column) (set-buffer-pos-col! buffer first-column)
(set-buffer-history-pos! buffer (set-buffer-history-pos! buffer
(+ (length (buffer-text buffer)) 1))) (- (length (buffer-text buffer)) 1)))
;; backspace ;; backspace
((and (= ch key-backspace) ((and (= ch key-backspace)
(buffer-can-write buffer) (buffer-can-write buffer)