ui.tools.listener: make all call-listener use with-ctrl-break.

char-rename
John Benediktsson 2016-11-02 11:04:52 -07:00
parent 5f38ec1a4a
commit 4f2a1a2e4e
2 changed files with 8 additions and 10 deletions

View File

@ -285,9 +285,10 @@ M: string listener-input
[ set-editor-string ] [ request-focus ] bi ; [ set-editor-string ] [ request-focus ] bi ;
: call-listener ( quot command -- ) : call-listener ( quot command -- )
get-ready-listener get-ready-listener '[
'[ _ _ _ dup wait-for-listener (call-listener) ] _ _ _ dup wait-for-listener
"Listener call" spawn drop ; [ (call-listener) ] with-ctrl-break
] "Listener call" spawn drop ;
M: listener-command invoke-command ( target command -- ) M: listener-command invoke-command ( target command -- )
[ command-quot ] [ nip ] 2bi call-listener ; [ command-quot ] [ nip ] 2bi call-listener ;

View File

@ -1,16 +1,13 @@
! Copyright (C) 2006, 2009 Slava Pestov. ! Copyright (C) 2006, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: kernel listener memory system ui ui.commands ui.gestures USING: memory system ui ui.commands ui.gestures ui.tools.browser
ui.private ui.tools.browser ui.tools.common ui.tools.error-list ui.tools.common ui.tools.error-list ui.tools.listener
ui.tools.listener ui.tools.operations ui.tools.walker
vocabs.refresh ; vocabs.refresh ;
IN: ui.tools IN: ui.tools
MAIN: listener-window MAIN: listener-window
: refresh-all-cmd ( -- ) [ refresh-all ] with-ctrl-break ; \ refresh-all H{ { +nullary+ t } { +listener+ t } } define-command
\ refresh-all-cmd H{ { +nullary+ t } { +listener+ t } } define-command
\ save H{ { +nullary+ t } } define-command \ save H{ { +nullary+ t } } define-command
@ -29,6 +26,6 @@ tool "common" f {
{ T{ key-down f { A+ } "w" } close-window } { T{ key-down f { A+ } "w" } close-window }
{ T{ key-down f { A+ } "F" } toggle-fullscreen } { T{ key-down f { A+ } "F" } toggle-fullscreen }
{ T{ key-down f { A+ } "q" } com-exit } { T{ key-down f { A+ } "q" } com-exit }
{ T{ key-down f f "F2" } refresh-all-cmd } { T{ key-down f f "F2" } refresh-all }
{ T{ key-down f f "F3" } show-error-list } { T{ key-down f f "F3" } show-error-list }
} define-command-map } define-command-map