add function buffer-text-append-new-line!

This commit is contained in:
eknauel 2005-05-22 09:18:07 +00:00
parent fefb4b002d
commit 1ccfa8dccc
2 changed files with 28 additions and 21 deletions

View File

@ -73,6 +73,11 @@
(list-ref (buffer-text buffer)
(- (buffer-pos-line buffer) 1)))
(define (buffer-text-append-new-line! buffer)
(set-buffer-text! buffer
(append (buffer-text buffer)
(list ""))))
;;handle input
(define (input buffer ch)
(cond
@ -318,23 +323,23 @@
(new-y (- (+ (- pos-fin-ln no-wrapped-lines)
first-line-offset)
1)))
(debug-message "num-cols "
num-cols
" no-wrapped-lines "
no-wrapped-lines
" first-line-offset "
first-line-offset
" new-y " new-y
" length "
item-length
" pos-fin-ln "
pos-fin-ln
" text-index "
text-index
" pos-line "
(buffer-pos-line buffer)
" num-lines "
num-lines)
; (debug-message "num-cols "
; num-cols
; " no-wrapped-lines "
; no-wrapped-lines
; " first-line-offset "
; first-line-offset
; " new-y " new-y
; " length "
; item-length
; " pos-fin-ln "
; pos-fin-ln
; " text-index "
; text-index
; " pos-line "
; (buffer-pos-line buffer)
; " num-lines "
; num-lines)
; (if (and (not (zero? text-index))
; (zero? (remainder text-index num-cols))
@ -368,10 +373,10 @@
(set-buffer-pos-x! buffer (+ first-column
(modulo text-index num-cols)))
(debug-message "cursor position "
(buffer-pos-x buffer)
" "
(buffer-pos-y buffer))
; (debug-message "cursor position "
; (buffer-pos-x buffer)
; " "
; (buffer-pos-y buffer))
; (debug-message "num-cols " num-cols
; " pos-col " pos-col
; " text '" (buffer-text-current-line buffer) "'")

View File

@ -361,6 +361,8 @@
buffer-history-pos
set-buffer-history-pos!
make-buffer
buffer-text-current-line
buffer-text-append-new-line!
input
print-command-buffer
cursor-right-pos