File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,29 @@ include("legacy.jl")
1616
1717using  . StyledMarkup
1818
19- function  __init__ ()
19+ const  HAVE_LOADED_CUSTOMISATIONS =  Base. Threads. Atomic {Bool} (false )
20+ 
21+ """ 
22+     load_customisations!(; force::Bool=false) 
23+ 
24+ Load customisations from the user's `faces.toml` file, if it exists as well as 
25+ the current environment. 
26+ 
27+ This function should be called before producing any output in situations where 
28+ the user's customisations should be considered. 
29+ 
30+ Unless `force` is set, customisations are only applied when this function is 
31+ called for the first time, and subsequent calls are a no-op. 
32+ """ 
33+ function  load_customisations! (; force:: Bool = false )
34+     ! force &&  HAVE_LOADED_CUSTOMISATIONS[] &&  return 
2035    if  ! isempty (DEPOT_PATH )
2136        userfaces =  joinpath (first (DEPOT_PATH ), " config" " faces.toml" 
2237        isfile (userfaces) &&  loaduserfaces! (userfaces)
2338    end 
2439    Legacy. load_env_colors! ()
40+     HAVE_LOADED_CUSTOMISATIONS[] =  true 
41+     nothing 
2542end 
2643
2744if  Base. generating_output ()
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments