anchor.diff:      procedure DoFileOpen(const fn: string);
       procedure DoFileSave(ASaveAs: boolean; ASaveDlg: TSaveDialog);
       procedure DoFileReload(ADetectEnc: boolean);
  +    procedure DoSaveHistory;
  +    procedure DoSaveHistoryEx(c: TJsonConfig; const APath: string; AMaxFiles: integer);
       procedure DoLoadHistory;
  -    procedure DoSaveHistory;
  +    procedure DoLoadHistoryEx(c: TJsonConfig; const APath: string);
       //event
       property OnFocusEditor: TNotifyEvent read FOnFocusEditor write FOnFocusEditor;
       property OnChangeCaption: TNotifyEvent read FOnChangeCaption write FOnChangeCaption;
  
positive.code:       exit
      end;
  
      //file not listed?
      if c.GetValue(fn+cSavTop, -1)<0 then exit;
  
      //lexer
      if Lexer=nil then str0:= '' else str0:= Lexer.LexerName;
      str:= c.GetValue(fn+cSavLexer, str0);
      if str<>str0 then
        Lexer:= Manager.FindAnalyzer(str);
  
      //enc
      str0:= EncodingName;
      str:= c.GetValue(fn+cSavEnc, str0);
      if str<>str0 then
      begin
        EncodingName:= str;
        Editor.LoadFromFile(FileName); //reread in enc
      end;
  
      TabColor:= StringToColorDef(c.GetValue(fn+cSavColor, ''), clNone);
  
      Editor.OptWrapMode:= TATSynWrapMode(c.GetValue(fn+cSavWrap, Ord(Editor.OptWrapMode)));
      Editor.ModeReadOnly:= c.GetValue(fn+cSavRO, Editor.ModeReadOnly);
      Editor.OptRulerVisible:= c.GetValue(fn+cSavRuler, Editor.OptRulerVisible);
      Editor.OptMinimapVisible:= c.GetValue(fn+cSavMinimap, Editor.OptMinimapVisible);
      Editor.OptTabSize:= c.GetValue(fn+cSavTabSize, Editor.OptTabSize);
      Editor.OptTabSpaces:= c.GetValue(fn+cSavTabSpace, Editor.OptTabSpaces);
  
      Editor.OptUnprintedVisible:= c.GetValue(fn+cSavUnpri, Editor.OptUnprintedVisible);
      Editor.OptUnprintedSpaces:= c.GetValue(fn+cSavUnpriSp, Editor.OptUnprintedSpaces);
      Editor.OptUnprintedEnds:= c.GetValue(fn+cSavUnpriEnd, Editor.OptUnprintedEnds);
      Editor.OptUnprintedEndsDetails:= c.GetValue(fn+cSavUnpriEndDet, Editor.OptUnprintedEndsDetails);
  
      with Editor.Gutter[Editor.GutterBandNum] do
        Visible:= c.GetValue(fn+cSavNums, Visible);
  
      //caret
      if Editor.Carets.Count>0 then
      begin
        caret:= Editor.Carets[0];
        caret.PosX:= c.GetValue(fn+cSavCaret+'/x', 0);
        caret.PosY:= c.GetValue(fn+cSavCaret+'/y', 0);
        caret.EndX:= c.GetValue(fn+cSavCaret+'/x2', -1);
        caret.EndY:= c.GetValue(fn+cSavCaret+'/y2', -1);
        Editor.UpdateIncorrectCaretPositions;
      end;
  
      //bookmarks
      items:= TStringlist.create;
      try
        c.GetValue(fn+cSavBookmark, items, '');
        for i:= 0 to items.Count-1 do
        begin
          nTop:= StrToIntDef(items[i], -1);
          if Editor.Strings.IsIndexValid(nTop) then
            Editor.Strings.LinesBm[nTop]:= 1;
        end;
      finally
        FreeAndNil(items);
      end;
  
      Editor.Update;
      if Splitted then
        Editor2.Update;
  
      //topline
      nTop:= c.GetValue(fn+cSavTop, 0);
      if nTop>0 then
      begin
        Application.ProcessMessages;
        Editor.LineTop:= nTop;
      end;
  
    finally
      c.Free;
    end;
  end;
  
  
negative.code: procedure TEditorFrame.DoSaveHistory;
  var
    c: TJSONConfig;
  begin
    if FileName='' then exit;
    if UiOps.MaxHistoryFiles<2 then exit;
  
    c:= TJsonConfig.Create(nil);
    try
  