Fix update of cursor position in an extremly ugly faishon.

This commit is contained in:
eknauel 2005-05-11 08:21:02 +00:00
parent 7dd48a3e47
commit ddaf279938
1 changed files with 34 additions and 16 deletions

View File

@ -417,6 +417,28 @@
(set! can-write-command can-write) (set! can-write-command can-write)
(set! command-history-pos history-pos))) (set! command-history-pos history-pos)))
(paint-command-window-contents) (paint-command-window-contents)
(set! command-buffer
(move-cursor command-buffer))
(let ((text (buffer-text command-buffer))
(pos-line (buffer-pos-line command-buffer))
(pos-col (buffer-pos-col command-buffer))
(pos-fin-ln (buffer-pos-fin-ln command-buffer))
(pos-y (buffer-pos-y command-buffer))
(pos-x (buffer-pos-x command-buffer))
(num-lines (buffer-num-lines command-buffer))
(num-cols (buffer-num-cols command-buffer))
(can-write (buffer-can-write command-buffer))
(history-pos (buffer-history-pos command-buffer)))
(set! text-command text)
(set! pos-command pos-line)
(set! pos-command-col pos-col)
(set! pos-command-fin-ln pos-fin-ln)
(set! command-buffer-pos-y pos-y)
(set! command-buffer-pos-x pos-x)
(set! command-lines num-lines)
(set! command-cols num-cols)
(set! can-write-command can-write)
(set! command-history-pos history-pos))
(loop (wait-for-input))))))))))) (loop (wait-for-input)))))))))))
(define (window-init-curses-win! window) (define (window-init-curses-win! window)
@ -504,11 +526,7 @@
(paint-result-window) (paint-result-window)
(set! command-buffer (set! command-buffer
(cur-right-pos (app-window-curses-win command-window) (move-cursor command-buffer))
(app-window-curses-win result-window)
(app-window-height command-window)
(app-window-height result-window)
command-buffer))
(let ((text (buffer-text command-buffer)) (let ((text (buffer-text command-buffer))
(pos-line (buffer-pos-line command-buffer)) (pos-line (buffer-pos-line command-buffer))
@ -868,17 +886,17 @@
;;Cursor ;;Cursor
;;move cursor to the corrct position ;;move cursor to the corrct position
(define cur-right-pos (define (move-cursor buffer)
(lambda (comwin reswin comwin-h reswin-h buffer) (begin
(begin (if (focus-on-command-buffer?)
(if (focus-on-command-buffer?) (cursor-right-pos (app-window-curses-win command-window)
(cursor-right-pos comwin buffer) buffer)
(begin (begin
(compute-y-x) (compute-y-x)
(wmove reswin result-buffer-pos-y result-buffer-pos-x) (wmove (app-window-curses-win result-window)
(wrefresh reswin) result-buffer-pos-y result-buffer-pos-x)
buffer))))) (wrefresh (app-window-curses-win result-window))
buffer))))
;;compue pos-x and pos-y ;;compue pos-x and pos-y
(define compute-y-x (define compute-y-x