Make paste (C-x p) work again (at least for the fsobjects-viewer)
This commit is contained in:
parent
af61cbb3ae
commit
5bd69b564b
|
@ -197,19 +197,43 @@
|
|||
(select-list-handle-key-press select-list key))
|
||||
self)))
|
||||
|
||||
(lambda (message)
|
||||
(cond
|
||||
((eq? message 'paint)
|
||||
(lambda (self . args)
|
||||
(apply paint-browser
|
||||
(append (list select-list working-dir) args))))
|
||||
(define (prepare-selection-for-scheme-mode file-names)
|
||||
(string-append "'" (exp->string file-names)))
|
||||
|
||||
((eq? message 'key-press)
|
||||
(lambda (self key control-x-pressed?)
|
||||
(handle-key-press self key)))
|
||||
(define (prepare-selection-for-command-mode file-names)
|
||||
(string-join
|
||||
(map (lambda (file-name)
|
||||
(string-append "\"" file-name "\""))
|
||||
file-names)))
|
||||
|
||||
(define (get-selection self for-scheme-mode?)
|
||||
(let* ((marked (select-list-get-selection select-list))
|
||||
(file-names
|
||||
(map fs-object-complete-path
|
||||
(if (null? marked)
|
||||
(list (select-list-selected-entry select-list))
|
||||
marked))))
|
||||
((if for-scheme-mode?
|
||||
prepare-selection-for-scheme-mode
|
||||
prepare-selection-for-command-mode)
|
||||
file-names)))
|
||||
|
||||
(lambda (message)
|
||||
(cond
|
||||
((eq? message 'paint)
|
||||
(lambda (self . args)
|
||||
(apply paint-browser
|
||||
(append (list select-list working-dir) args))))
|
||||
|
||||
((eq? message 'key-press)
|
||||
(lambda (self key control-x-pressed?)
|
||||
(handle-key-press self key)))
|
||||
|
||||
((eq? message 'get-selection)
|
||||
get-selection)
|
||||
|
||||
(else
|
||||
(error "fsobjects-viewer unknown message" message)))))))
|
||||
(else
|
||||
(error "fsobjects-viewer unknown message" message)))))))
|
||||
|
||||
(define (list-of-fs-objects? thing)
|
||||
(and (proper-list? thing)
|
||||
|
|
|
@ -347,7 +347,21 @@
|
|||
(current-history-item)
|
||||
(= ch 112))
|
||||
(add-string-to-command-buffer
|
||||
(send (current-viewer) 'get-selection))
|
||||
(send (current-viewer) 'get-selection (command-buffer-in-scheme-mode?)))
|
||||
(print-command-buffer (app-window-curses-win command-window)
|
||||
command-buffer)
|
||||
(move-cursor command-buffer result-buffer)
|
||||
(refresh-command-window)
|
||||
(loop (wait-for-input) #f #f))
|
||||
|
||||
((and c-x-pressed? (focus-on-result-buffer?)
|
||||
(= ch 112))
|
||||
(add-string-to-command-buffer
|
||||
(send (current-viewer) 'get-selection (command-buffer-in-scheme-mode?)))
|
||||
(focus-command-buffer!)
|
||||
(print-command-buffer (app-window-curses-win command-window)
|
||||
command-buffer)
|
||||
(move-cursor command-buffer result-buffer)
|
||||
(refresh-command-window)
|
||||
(loop (wait-for-input) #f #f))
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
(open (modify nuit-eval (hide string-copy))
|
||||
srfi-1
|
||||
(subset srfi-13
|
||||
(string-copy string-drop
|
||||
(string-copy string-drop string-join
|
||||
string-drop-right string-prefix-length))
|
||||
signals
|
||||
let-opt
|
||||
|
|
Loading…
Reference in New Issue