]> gitweb.factorcode.org Git - factor.git/commitdiff
tools.crossref: fix for not-enough crossref resetting
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 20 Jan 2022 19:59:43 +0000 (11:59 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 20 Jan 2022 19:59:43 +0000 (11:59 -0800)
basis/tools/crossref/crossref.factor

index 5f883aa51ce9fcdb1e9c40e2b0dbac0ab852a8b2..3183f4ddae1622240030d84d203a5e8fc5900329 100644 (file)
@@ -141,7 +141,10 @@ M: f smart-usage drop \ f smart-usage ;
 SINGLETON: invalidate-crossref
 
 M: invalidate-crossref definitions-changed
-    drop null? [ f crossref set-global ] unless ;
+    ! reset crossref on non-empty definitions or f which
+    ! indicates a source-file was parsed, cache otherwise
+    drop [ null? not ] [ not ] bi or
+    [ f crossref set-global ] when ;
 
 [ invalidate-crossref add-definition-observer ] "tools.crossref" add-startup-hook