 
 \ error-list-help H{ { +nullary+ t } } define-command
 
-error-list-gadget "toolbar" f {
+\ error-list-gadget "toolbar" f {
     { T{ key-down f f "F1" } error-list-help }
 } define-command-map
 
-: error-list-window ( -- )
-    error-list-model get [ drop all-errors ] <arrow>
-    <error-list-gadget> "Errors" open-status-window ;
+MEMO: error-list-gadget ( -- gadget )
+    error-list-model get-global [ drop all-errors ] <arrow>
+    <error-list-gadget> ;
 
 : show-error-list ( -- )
-    [ error-list-gadget? ] find-window
-    [ raise-window ] [ error-list-window ] if* ;
+    [ error-list-gadget eq? ] find-window
+    [ raise-window ] [ error-list-gadget "Errors" open-status-window ] if* ;
 
 \ show-error-list H{ { +nullary+ t } } define-command

    [ swap '[ error-type _ at ] filter ] <smart-arrow> ;

:: <error-list-gadget> ( model -- gadget )
    vertical error-list-gadget new-track
        <error-toggle> [ >>error-toggle ] [ >>visible-errors ] bi*
        dup visible-errors>> model <error-model> >>model 
        f <model> >>source-file

! Copyright (C) 2009, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays sequences sorting assocs colors.constants fry
combinators combinators.smart combinators.short-circuit editors make
