use `m' and `u' for selecting/unselecting items
This commit is contained in:
parent
0a2c373bc0
commit
f649bb93cc
|
@ -12,6 +12,8 @@
|
||||||
|
|
||||||
;;If the given path does not exist you will not be able to navigate!
|
;;If the given path does not exist you will not be able to navigate!
|
||||||
|
|
||||||
|
(define key-m 109)
|
||||||
|
(define key-u 117)
|
||||||
|
|
||||||
(define-record-type browse-dir-list-res-obj browse-dir-list-res-obj
|
(define-record-type browse-dir-list-res-obj browse-dir-list-res-obj
|
||||||
(make-browse-dir-list-res-obj pos-y
|
(make-browse-dir-list-res-obj pos-y
|
||||||
|
@ -192,10 +194,10 @@
|
||||||
(key (key-pressed-message-key message))
|
(key (key-pressed-message-key message))
|
||||||
(c-x-pressed (browse-dir-list-res-obj-c-x-pressed model)))
|
(c-x-pressed (browse-dir-list-res-obj-c-x-pressed model)))
|
||||||
|
|
||||||
(if c-x-pressed
|
|
||||||
(cond
|
(cond
|
||||||
;;Ctrl+x s -> Auswahl
|
|
||||||
((= key 115)
|
;; user pressed 'm' --- mark current entry
|
||||||
|
((= key key-m)
|
||||||
(let* ((marked-items (browse-dir-list-res-obj-marked-items model))
|
(let* ((marked-items (browse-dir-list-res-obj-marked-items model))
|
||||||
(res-marked-items (browse-dir-list-res-obj-res-marked-items
|
(res-marked-items (browse-dir-list-res-obj-res-marked-items
|
||||||
model))
|
model))
|
||||||
|
@ -206,7 +208,7 @@
|
||||||
(let ((actual-item (list-ref all-items (- actual-pos 3)))
|
(let ((actual-item (list-ref all-items (- actual-pos 3)))
|
||||||
(actual-res-item #f))
|
(actual-res-item #f))
|
||||||
(begin
|
(begin
|
||||||
(if (not (equal? (cwd) "/"))
|
(if (not (string=? (cwd) "/"))
|
||||||
(set! actual-res-item (string-append (cwd) "/" actual-item))
|
(set! actual-res-item (string-append (cwd) "/" actual-item))
|
||||||
(set! actual-res-item (string-append "/" actual-item)))
|
(set! actual-res-item (string-append "/" actual-item)))
|
||||||
(if (member actual-res-item marked-items)
|
(if (member actual-res-item marked-items)
|
||||||
|
@ -233,8 +235,8 @@
|
||||||
#f)))
|
#f)))
|
||||||
new-model)))))))
|
new-model)))))))
|
||||||
|
|
||||||
;;Ctrl+x u -> unselect
|
;; user pressed 'u' --- unmark current entry
|
||||||
((= key 117)
|
((= key key-u)
|
||||||
(let* ((marked-items (browse-dir-list-res-obj-marked-items model))
|
(let* ((marked-items (browse-dir-list-res-obj-marked-items model))
|
||||||
(res-marked-items (browse-dir-list-res-obj-res-marked-items
|
(res-marked-items (browse-dir-list-res-obj-res-marked-items
|
||||||
model))
|
model))
|
||||||
|
@ -281,37 +283,6 @@
|
||||||
new-res-marked-items
|
new-res-marked-items
|
||||||
#f)))
|
#f)))
|
||||||
new-model))))))
|
new-model))))))
|
||||||
(else
|
|
||||||
(make-browse-dir-list-res-obj
|
|
||||||
(browse-dir-list-res-obj-pos-y model)
|
|
||||||
(browse-dir-list-res-obj-pos-x model)
|
|
||||||
(browse-dir-list-res-obj-file-list model)
|
|
||||||
(browse-dir-list-res-obj-result-text model)
|
|
||||||
(browse-dir-list-res-obj-working-directory
|
|
||||||
model)
|
|
||||||
(browse-dir-list-res-obj-width model)
|
|
||||||
(browse-dir-list-res-obj-initial-wd model)
|
|
||||||
(browse-dir-list-res-obj-marked-items model)
|
|
||||||
(browse-dir-list-res-obj-res-marked-items
|
|
||||||
model)
|
|
||||||
(not c-x-pressed))))
|
|
||||||
|
|
||||||
(cond
|
|
||||||
;;c-x
|
|
||||||
((= key 24)
|
|
||||||
(make-browse-dir-list-res-obj
|
|
||||||
(browse-dir-list-res-obj-pos-y model)
|
|
||||||
(browse-dir-list-res-obj-pos-x model)
|
|
||||||
(browse-dir-list-res-obj-file-list model)
|
|
||||||
(browse-dir-list-res-obj-result-text model)
|
|
||||||
(browse-dir-list-res-obj-working-directory
|
|
||||||
model)
|
|
||||||
(browse-dir-list-res-obj-width model)
|
|
||||||
(browse-dir-list-res-obj-initial-wd model)
|
|
||||||
(browse-dir-list-res-obj-marked-items model)
|
|
||||||
(browse-dir-list-res-obj-res-marked-items
|
|
||||||
model)
|
|
||||||
(not c-x-pressed)))
|
|
||||||
|
|
||||||
((= key key-up)
|
((= key key-up)
|
||||||
(let ((posy (browse-dir-list-res-obj-pos-y model)))
|
(let ((posy (browse-dir-list-res-obj-pos-y model)))
|
||||||
|
@ -358,9 +329,23 @@
|
||||||
((= key 10)
|
((= key 10)
|
||||||
(selected-browse-dir-list model))
|
(selected-browse-dir-list model))
|
||||||
|
|
||||||
|
;; user pressed C-x
|
||||||
|
((= key 24)
|
||||||
|
(make-browse-dir-list-res-obj
|
||||||
|
(browse-dir-list-res-obj-pos-y model)
|
||||||
|
(browse-dir-list-res-obj-pos-x model)
|
||||||
|
(browse-dir-list-res-obj-file-list model)
|
||||||
|
(browse-dir-list-res-obj-result-text model)
|
||||||
|
(browse-dir-list-res-obj-working-directory
|
||||||
|
model)
|
||||||
|
(browse-dir-list-res-obj-width model)
|
||||||
|
(browse-dir-list-res-obj-initial-wd model)
|
||||||
|
(browse-dir-list-res-obj-marked-items model)
|
||||||
|
(browse-dir-list-res-obj-res-marked-items
|
||||||
|
model)
|
||||||
|
(not c-x-pressed)))
|
||||||
|
|
||||||
|
(else model))))
|
||||||
(else model)))))
|
|
||||||
|
|
||||||
|
|
||||||
((restore-message? message)
|
((restore-message? message)
|
||||||
|
|
Loading…
Reference in New Issue