anchor.diff:  implementation
   
   var
  -  _LoadedModules: TStringList = nil;
  +  _LoadedCudatext: boolean = false;
     _LoadedLocals: TStringList = nil;
   
   const
     _LoadedPrefix = 'xx';
     //must be the same as in file py/cudatext_reset_plugins.py
  -
  -function IsPyLoadedModule(const S: string): boolean; inline;
  -begin
  -  Result:= _LoadedModules.IndexOf(S)>=0;
  -end;
   
   function IsPyLoadedLocal(const S: string): boolean; inline;
   begin
  
positive.code: 
    SObj:= _LoadedPrefix+AModule;
  
    if not IsPyLoadedModule('cudatext') then
    begin
      with GetPythonEngine do
        ExecString('import cudatext');
      _LoadedModules.Add('cudatext');
    end;
  
    if not ALazy then
  
negative.code: 
  procedure PyClearLoadedModuleLists;
  begin
    _LoadedCudatext:= false;
    _LoadedLocals.Clear;
  end;
  
  initialization
  
    _LoadedLocals:= TStringList.Create;
  
  finalization
  
    FreeAndNil(_LoadedLocals);
  
  end.
  
  