split PAINT into PAINT and WAIT-FOR-INPUT. Call PRINT-RESULT-BUFFER
to redraw only the result-buffer.
This commit is contained in:
parent
c9f6b17692
commit
599021b937
|
@ -248,7 +248,8 @@
|
|||
(set! active-keyboard-interrupt a)))
|
||||
|
||||
;;Loop
|
||||
(let loop ((ch (paint)))
|
||||
(paint)
|
||||
(let loop ((ch (wait-for-input)))
|
||||
(cond
|
||||
|
||||
;;The result of pressing these keys is independent of which
|
||||
|
@ -278,17 +279,20 @@
|
|||
current-result-object
|
||||
ch)))
|
||||
(set! current-result-object (switch key-message))))
|
||||
(loop (paint))))
|
||||
(paint)
|
||||
(loop (wait-for-input))))
|
||||
|
||||
;; forward in result history
|
||||
((= ch key-npage)
|
||||
(history-forward)
|
||||
(loop (paint)))
|
||||
(print-result-buffer result-win)
|
||||
(loop (wait-for-input)))
|
||||
|
||||
;; back in result history
|
||||
((= ch key-ppage)
|
||||
(history-back)
|
||||
(loop (paint)))
|
||||
(print-result-buffer result-win)
|
||||
(loop (wait-for-input)))
|
||||
|
||||
|
||||
;;if lower window is active a message is sent.
|
||||
|
@ -309,7 +313,7 @@
|
|||
(set! current-result-object (switch key-message))))
|
||||
(set! active-buffer 1))
|
||||
(set! c-x-pressed #f)
|
||||
(loop (paint))))
|
||||
(loop (wait-for-input))))
|
||||
|
||||
;;C-x r -> redo
|
||||
((= ch 114)
|
||||
|
@ -330,7 +334,7 @@
|
|||
(run)))
|
||||
(begin
|
||||
(set! c-x-pressed #f)
|
||||
(loop (paint)))))
|
||||
(loop (wait-for-input)))))
|
||||
|
||||
(else
|
||||
(begin
|
||||
|
@ -348,7 +352,7 @@
|
|||
(marked-items (switch message)))
|
||||
(add-string-to-command-buffer marked-items))))
|
||||
(set! c-x-pressed #f)
|
||||
(loop (paint)))))
|
||||
(loop (wait-for-input)))))
|
||||
|
||||
(if (= active-buffer 2)
|
||||
(let ((key-message
|
||||
|
@ -357,7 +361,7 @@
|
|||
ch)))
|
||||
(begin
|
||||
(set! current-result-object (switch key-message))
|
||||
(loop (paint))))
|
||||
(loop (wait-for-input))))
|
||||
|
||||
(cond
|
||||
|
||||
|
@ -431,15 +435,12 @@
|
|||
(set! command-cols num-cols)
|
||||
(set! can-write-command can-write)
|
||||
(set! command-history-pos history-pos)))
|
||||
(loop (paint)))))))))))))
|
||||
|
||||
(paint)
|
||||
(loop (wait-for-input)))))))))))))
|
||||
|
||||
;;print and wait for input
|
||||
(define paint
|
||||
(lambda ()
|
||||
(begin
|
||||
(define (paint)
|
||||
(init-screen)
|
||||
;(cbreak)
|
||||
(let* ((bar1-y 1)
|
||||
(bar1-x 1)
|
||||
(bar1-h 2)
|
||||
|
@ -530,16 +531,15 @@
|
|||
; (wrefresh result-win)
|
||||
; (wrefresh bar1)
|
||||
; (wrefresh bar2)
|
||||
))
|
||||
|
||||
|
||||
(define (wait-for-input)
|
||||
(noecho)
|
||||
(keypad bar1 #t)
|
||||
(set! active-keyboard-interrupt #f)
|
||||
(let ((ch (wgetch bar1)))
|
||||
(echo)
|
||||
ch
|
||||
)))))
|
||||
|
||||
ch))
|
||||
|
||||
;;If the user presses enter the last line is interpreted as a command
|
||||
;;which has to be executed.
|
||||
|
|
Loading…
Reference in New Issue