anchor.diff:        exit
       end;
   
  -    items:= TStringlist.Create;
  -    try
  -      c.DeletePath(fn);
  -      c.EnumSubKeys('/', items);
  -      while items.Count>=UiOps.MaxHistoryFiles do
  -      begin
  -        c.DeletePath(items[0]);
  -        items.Delete(0);
  -      end;
  -    finally
  -      FreeAndNil(items);
  -    end;
  -
  -    c.SetValue(fn+cSavLexer, lexname);
  -    c.SetValue(fn+cSavEnc, EncodingName);
  -    c.SetValue(fn+cSavTop, Editor.LineTop);
  -    c.SetValue(fn+cSavWrap, Ord(Editor.OptWrapMode));
  -    c.SetValue(fn+cSavRO, Editor.ModeReadOnly);
  -    c.SetValue(fn+cSavRuler, Editor.OptRulerVisible);
  -    c.SetValue(fn+cSavMinimap, Editor.OptMinimapVisible);
  -    c.SetValue(fn+cSavTabSize, Editor.OptTabSize);
  -    c.SetValue(fn+cSavTabSpace, Editor.OptTabSpaces);
  -    c.SetValue(fn+cSavUnpri, Editor.OptUnprintedVisible);
  -    c.SetValue(fn+cSavUnpriSp, Editor.OptUnprintedSpaces);
  -    c.SetValue(fn+cSavUnpriEnd, Editor.OptUnprintedEnds);
  -    c.SetValue(fn+cSavUnpriEndDet, Editor.OptUnprintedEndsDetails);
  -    c.SetValue(fn+cSavNums, Editor.Gutter[Editor.GutterBandNum].Visible);
  -
  -    if TabColor=clNone then
  -      c.SetValue(fn+cSavColor, '')
  -    else
  -      c.SetValue(fn+cSavColor, ColorToString(TabColor));
  -
  -    if Editor.Carets.Count>0 then
  +    DoSaveHistoryEx(c, '', UiOps.MaxHistoryFiles);
  +  finally
  +    c.Free;
  +  end;
  +end;
  +
  +procedure TEditorFrame.DoSaveHistoryEx(c: TJsonConfig; const APath: string;
  +  AMaxFiles: integer);
  +var
  +  fn, lexname: string;
  +  caret: TATCaretItem;
  +  items: TStringlist;
  +  i: integer;
  +begin
  +  if FileName='' then exit;
  +  if Lexer=nil then lexname:= '' else lexname:= Lexer.LexerName;
  +  fn:= APath+'/'+SMaskFilenameSlashes(FileName);
  +
  +  items:= TStringlist.Create;
  +  try
  +    c.DeletePath(fn);
  +    c.EnumSubKeys(APath+'/', items);
  +    while items.Count>=AMaxFiles do
       begin
  -      caret:= Editor.Carets[0];
  -      c.SetValue(fn+cSavCaret+'/x', caret.PosX);
  -      c.SetValue(fn+cSavCaret+'/y', caret.PosY);
  -      c.SetValue(fn+cSavCaret+'/x2', caret.EndX);
  -      c.SetValue(fn+cSavCaret+'/y2', caret.EndY);
  -    end;
  -
  -    items:= TStringlist.Create;
  -    try
  -      for i:= 0 to Editor.Strings.Count-1 do
  -        if Editor.Strings.LinesBm[i]>0 then
  -          items.Add(Inttostr(i));
  -      c.SetValue(fn+cSavBookmark, items);
  -    finally
  -      FreeAndNil(items);
  +      c.DeletePath(APath+'/'+items[0]);
  +      items.Delete(0);
       end;
     finally
  -    c.Free;
  +    FreeAndNil(items);
  +  end;
  +
  +  c.SetValue(fn+cSavLexer, lexname);
  +  c.SetValue(fn+cSavEnc, EncodingName);
  +  c.SetValue(fn+cSavTop, Editor.LineTop);
  +  c.SetValue(fn+cSavWrap, Ord(Editor.OptWrapMode));
  +  c.SetValue(fn+cSavRO, Editor.ModeReadOnly);
  +  c.SetValue(fn+cSavRuler, Editor.OptRulerVisible);
  +  c.SetValue(fn+cSavMinimap, Editor.OptMinimapVisible);
  +  c.SetValue(fn+cSavTabSize, Editor.OptTabSize);
  +  c.SetValue(fn+cSavTabSpace, Editor.OptTabSpaces);
  +  c.SetValue(fn+cSavUnpri, Editor.OptUnprintedVisible);
  +  c.SetValue(fn+cSavUnpriSp, Editor.OptUnprintedSpaces);
  +  c.SetValue(fn+cSavUnpriEnd, Editor.OptUnprintedEnds);
  +  c.SetValue(fn+cSavUnpriEndDet, Editor.OptUnprintedEndsDetails);
  +  c.SetValue(fn+cSavNums, Editor.Gutter[Editor.GutterBandNum].Visible);
  +
  +  if TabColor=clNone then
  +    c.SetValue(fn+cSavColor, '')
  +  else
  +    c.SetValue(fn+cSavColor, ColorToString(TabColor));
  +
  +  if Editor.Carets.Count>0 then
  +  begin
  +    caret:= Editor.Carets[0];
  +    c.SetValue(fn+cSavCaret+'/x', caret.PosX);
  +    c.SetValue(fn+cSavCaret+'/y', caret.PosY);
  +    c.SetValue(fn+cSavCaret+'/x2', caret.EndX);
  +    c.SetValue(fn+cSavCaret+'/y2', caret.EndY);
  +  end;
  +
  +  items:= TStringlist.Create;
  +  try
  +    for i:= 0 to Editor.Strings.Count-1 do
  +      if Editor.Strings.LinesBm[i]>0 then
  +        items.Add(Inttostr(i));
  +    c.SetValue(fn+cSavBookmark, items);
  +  finally
  +    FreeAndNil(items);
     end;
   end;
   
   procedure TEditorFrame.DoLoadHistory;
   var
     c: TJSONConfig;
  -  fn, str, str0: string;
  -  caret: TATCaretItem;
  -  nTop, i: integer;
  -  items: TStringlist;
   begin
     if FileName='' then exit;
     if UiOps.MaxHistoryFiles<2 then exit;
  -  fn:= SMaskFilenameSlashes(FileName);
   
     c:= TJsonConfig.Create(nil);
     try
  
positive.code: procedure TEditorFrame.DoSaveHistory;
  var
    c: TJSONConfig;
    fn, lexname: string;
    caret: TATCaretItem;
    items: TStringlist;
    i: integer;
  begin
    if FileName='' then exit;
    if UiOps.MaxHistoryFiles<2 then exit;
    fn:= SMaskFilenameSlashes(FileName);
    if Lexer=nil then lexname:= '' else lexname:= Lexer.LexerName;
  
    c:= TJsonConfig.Create(nil);
    try
  
negative.code:     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 DoLoadHistoryEx(c: TJsonConfig; const APath: string);
      //event
      property OnFocusEditor: TNotifyEvent read FOnFocusEditor write FOnFocusEditor;
      property OnChangeCaption: TNotifyEvent read FOnChangeCaption write FOnChangeCaption;
  