Constructor arguments instead of init message
This commit is contained in:
parent
8c9d2b7142
commit
43088dafd7
|
@ -126,27 +126,19 @@
|
||||||
(select-list-handle-key-press select-list key))
|
(select-list-handle-key-press select-list key))
|
||||||
instance))))
|
instance))))
|
||||||
|
|
||||||
(define (make-fsobjects-viewer)
|
(define (make-fsobjects-viewer fs-objects buffer)
|
||||||
(let ((fs-objects #f)
|
(let* ((fs-objects fs-objects)
|
||||||
(buffer #f)
|
(buffer buffer)
|
||||||
(select-list #f)
|
(working-dir (find-common-parent
|
||||||
(working-dir #f))
|
(map fs-object-path fs-objects)))
|
||||||
|
(select-list
|
||||||
|
(make-file-select-list fs-objects
|
||||||
|
working-dir
|
||||||
|
(result-buffer-num-lines buffer))))
|
||||||
|
|
||||||
(lambda (message)
|
(lambda (message)
|
||||||
(cond
|
(cond
|
||||||
|
|
||||||
((eq? message 'init)
|
|
||||||
(lambda (self new-fs-objects new-buffer)
|
|
||||||
(let ((num-lines (result-buffer-num-lines new-buffer))
|
|
||||||
(parent-dir
|
|
||||||
(find-common-parent
|
|
||||||
(map fs-object-path new-fs-objects))))
|
|
||||||
(set! buffer new-buffer)
|
|
||||||
(set! fs-objects new-fs-objects)
|
|
||||||
(set! working-dir parent-dir)
|
|
||||||
(set! select-list
|
|
||||||
(make-file-select-list fs-objects parent-dir num-lines))
|
|
||||||
self)))
|
|
||||||
|
|
||||||
((eq? message 'init-browser-for-dir)
|
((eq? message 'init-browser-for-dir)
|
||||||
(lambda (self new-dir new-buffer)
|
(lambda (self new-dir new-buffer)
|
||||||
(with-cwd new-dir
|
(with-cwd new-dir
|
||||||
|
|
Loading…
Reference in New Issue