Minor code clean-up, fix more redrawing stuff
This commit is contained in:
parent
88e805e52a
commit
03ffcf8280
|
@ -333,9 +333,9 @@
|
|||
(make-key-pressed-message active-command
|
||||
current-result-object
|
||||
ch)))
|
||||
(begin
|
||||
(set! current-result-object (switch key-message))
|
||||
(loop (wait-for-input))))
|
||||
(paint-result-window)
|
||||
(loop (wait-for-input)))
|
||||
|
||||
(cond
|
||||
|
||||
|
@ -344,7 +344,6 @@
|
|||
(let ((restore-message (make-restore-message
|
||||
active-command
|
||||
current-result-object)))
|
||||
(begin
|
||||
(switch restore-message)
|
||||
(execute-command)
|
||||
(set-buffer-history-pos!
|
||||
|
@ -354,15 +353,13 @@
|
|||
(paint-bar-2)
|
||||
(paint-command-window-contents)
|
||||
(move-cursor command-buffer)
|
||||
(loop (wait-for-input)))))
|
||||
(loop (wait-for-input))))
|
||||
|
||||
(else
|
||||
(begin
|
||||
(set! command-buffer (input command-buffer ch))
|
||||
(paint-command-window-contents)
|
||||
(set! command-buffer
|
||||
(move-cursor command-buffer))
|
||||
(loop (wait-for-input)))))))))))
|
||||
(move-cursor command-buffer)
|
||||
(loop (wait-for-input))))))))))
|
||||
|
||||
(define (window-init-curses-win! window)
|
||||
(set-app-window-curses-win!
|
||||
|
@ -452,8 +449,7 @@
|
|||
|
||||
;;If the user presses enter the last line is interpreted as a command
|
||||
;;which has to be executed.
|
||||
(define execute-command
|
||||
(lambda ()
|
||||
(define (execute-command)
|
||||
(let* ((com (list-ref (buffer-text command-buffer)
|
||||
(- (length (buffer-text command-buffer)) 1)))
|
||||
(com-par (extract-com-and-par com))
|
||||
|
@ -463,7 +459,6 @@
|
|||
(message (make-next-command-message
|
||||
command parameters result-cols))
|
||||
(model (switch message)))
|
||||
(begin
|
||||
(if (not (= history-pos 0))
|
||||
(let ((hist-entry (make-history-entry active-command
|
||||
active-parameters
|
||||
|
@ -471,20 +466,18 @@
|
|||
(active (make-history-entry command
|
||||
(get-param-as-str parameters)
|
||||
model)))
|
||||
(begin
|
||||
(if (< history-pos (length history))
|
||||
(set! history (append history (list hist-entry)))
|
||||
(set! history (append
|
||||
(sublist history 0
|
||||
(- (length history) 1))
|
||||
(list hist-entry) (list active))))
|
||||
(set! history-pos (length history))))
|
||||
(set! history-pos (length history)))
|
||||
(let ((hist-entry (make-history-entry
|
||||
command
|
||||
(get-param-as-str parameters) model)))
|
||||
(begin
|
||||
(set! history (list hist-entry))
|
||||
(set! history-pos 1))))
|
||||
(set! history-pos 1)))
|
||||
|
||||
(set-buffer-text! command-buffer
|
||||
(append (buffer-text command-buffer)
|
||||
|
@ -492,7 +485,7 @@
|
|||
(set! active-command command)
|
||||
(set! active-parameters (get-param-as-str parameters))
|
||||
(set! current-result-object model)
|
||||
(scroll-command-buffer)))))
|
||||
(scroll-command-buffer)))
|
||||
|
||||
;;Extracts the name of the function and its parameters
|
||||
(define extract-com-and-par
|
||||
|
@ -784,7 +777,6 @@
|
|||
;;Cursor
|
||||
;;move cursor to the corrct position
|
||||
(define (move-cursor buffer)
|
||||
(begin
|
||||
(if (focus-on-command-buffer?)
|
||||
(cursor-right-pos (app-window-curses-win command-window)
|
||||
buffer)
|
||||
|
@ -792,8 +784,7 @@
|
|||
(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))))
|
||||
(wrefresh (app-window-curses-win result-window)))))
|
||||
|
||||
;;compue pos-x and pos-y
|
||||
(define compute-y-x
|
||||
|
|
Loading…
Reference in New Issue