Fix update of cursor position in an extremly ugly faishon.
This commit is contained in:
parent
7dd48a3e47
commit
ddaf279938
|
@ -417,6 +417,28 @@
|
|||
(set! can-write-command can-write)
|
||||
(set! command-history-pos history-pos)))
|
||||
(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)))))))))))
|
||||
|
||||
(define (window-init-curses-win! window)
|
||||
|
@ -504,11 +526,7 @@
|
|||
(paint-result-window)
|
||||
|
||||
(set! command-buffer
|
||||
(cur-right-pos (app-window-curses-win command-window)
|
||||
(app-window-curses-win result-window)
|
||||
(app-window-height command-window)
|
||||
(app-window-height result-window)
|
||||
command-buffer))
|
||||
(move-cursor command-buffer))
|
||||
|
||||
(let ((text (buffer-text command-buffer))
|
||||
(pos-line (buffer-pos-line command-buffer))
|
||||
|
@ -868,17 +886,17 @@
|
|||
|
||||
;;Cursor
|
||||
;;move cursor to the corrct position
|
||||
(define cur-right-pos
|
||||
(lambda (comwin reswin comwin-h reswin-h buffer)
|
||||
(begin
|
||||
(if (focus-on-command-buffer?)
|
||||
(cursor-right-pos comwin buffer)
|
||||
(begin
|
||||
(compute-y-x)
|
||||
(wmove reswin result-buffer-pos-y result-buffer-pos-x)
|
||||
(wrefresh reswin)
|
||||
buffer)))))
|
||||
|
||||
(define (move-cursor buffer)
|
||||
(begin
|
||||
(if (focus-on-command-buffer?)
|
||||
(cursor-right-pos (app-window-curses-win command-window)
|
||||
buffer)
|
||||
(begin
|
||||
(compute-y-x)
|
||||
(wmove (app-window-curses-win result-window)
|
||||
result-buffer-pos-y result-buffer-pos-x)
|
||||
(wrefresh (app-window-curses-win result-window))
|
||||
buffer))))
|
||||
|
||||
;;compue pos-x and pos-y
|
||||
(define compute-y-x
|
||||
|
|
Loading…
Reference in New Issue