anchor.diff:        end;
       end;
     end;
  +
  +  FreeAndNil(KeysBackup);
   end;
   
   
  
positive.code:   Result:= acgOkCommand;
  end;
  
  
  procedure Keymap_UpdateDynamicEx(AKeymap: TATKeymap; ACategory: TAppCommandCategory);
  var
    CmdItem: TAppCommandInfo;
    Frame: TEditorFrame;
    An: TecSyntAnalyzer;
    sl: TStringList;
    Cmd, i: integer;
  begin
    for i:= AKeymap.Count-1 downto 0 do
    begin
      Cmd:= AKeymap[i].Command;
      if Cmd<cmdFirstAppCommand then Break;
      if AppCommandCategory(Cmd)=ACategory then
        AKeymap.Delete(i);
    end;
  
    case ACategory of
  
negative.code:         if CmdItem.ItemFromApi then Continue;
          if CmdItem.ItemModule='' then Break;
          if SEndsWith(CmdItem.ItemCaption, '-') then Continue;
  
          AKeymap.Add(
            cmdFirstPluginCommand+i,
            'plugin: '+AppNicePluginCaption(CmdItem.ItemCaption),
            [], []);
  
          //restore hotkey
          if _GetKeysBackup(KeysBackup,
            CmdItem.ItemModule+','+CmdItem.ItemProc+','+CmdItem.ItemProcParam,
            KeyRec1, KeyRec2) then
          begin
            MapItem:= AKeymap[AKeymap.Count-1];
            MapItem.Keys1:= KeyRec1;
            MapItem.keys2:= KeyRec2;
          end;
        end;
  
      categ_PluginSub:
  