anchor.diff:    end;
   end;
   
  +procedure UpdateColoredRangesInLexer(Frame: TEditorFrame; APrimaryEditor: boolean);
  +var
  +  Ada: TATAdapterEControl;
  +  Ed: TATSynEdit;
  +begin
  +  //current code is bad:
  +  //Ada.UpdateRangesFoldAndColored causes issue #4233
  +  exit;
  +
  +  if APrimaryEditor then
  +    Ed:= Frame.Ed1
  +  else
  +    Ed:= Frame.Ed2;
  +  Ada:= TATAdapterEControl(Frame.Adapter[Ed]);
  +  if Assigned(Ada) and Assigned(Ada.AnClient) then
  +  begin
  +    Ada.AnClient.CriSecForData.Enter;
  +    try
  +      Ada.UpdateRangesFoldAndColored;
  +    finally
  +      Ada.AnClient.CriSecForData.Leave;
  +    end;
  +  end;
  +end;
  +
   procedure TfmMain.DoApplyLexerStylesMapsToFrames(AndApplyTheme: boolean);
   var
     F: TEditorFrame;
     An, AnIncorrect: TecSyntAnalyzer;
  -  Ada: TATAdapterEControl;
     i: integer;
   begin
     for i:= 0 to FrameCount-1 do
  
positive.code:       begin
          DoApplyLexerStylesMap(An, AnIncorrect);
  
          {
          //update Markdown code-blocks
          if AndApplyTheme then
          begin
            Ada:= TATAdapterEControl(F.Adapter[F.Ed2]);
            if Assigned(Ada) and Assigned(Ada.AnClient) then
            begin
              Ada.AnClient.CriSecForData.Enter;
              try
                Ada.UpdateRangesFoldAndColored;
              finally
                Ada.AnClient.CriSecForData.Leave;
              end;
            end;
          end;
          }
        end;
      end;
  
  
negative.code:     begin
        DoApplyLexerStylesMap(An, AnIncorrect);
  
        //update Markdown code-blocks
        if AndApplyTheme then
          UpdateColoredRangesInLexer(F, true);
      end;
  
      if not F.EditorsLinked then
  