anchor.diff:    MaxDistance: integer;
     out FoundX, FoundY: integer);
   var
  -  TokenKind: TATFinderTokenKind;
     Level: integer;
     Kind: TATEditorBracketKind;
     ch, ch2: atChar;
  
positive.code:       for IndexX:= IndexXEnd downto IndexXBegin do
        begin
          ch:= S[IndexX+1];
          if (ch=CharFrom) and (EditorGetTokenKind(Ed, IndexX, IndexY)=TokenKind) then
            Inc(Level)
          else
          if (ch=CharTo) and (EditorGetTokenKind(Ed, IndexX, IndexY)=TokenKind) then
          begin
            if Level>0 then
              Dec(Level)
  
negative.code:     //find opening bracket backwards
      if Kind=bracketUnknown then
      begin
        EditorBracket_FindOpeningBracketBackward(Ed,
          PosX, PosY,
          AllowedSymbols,
          MaxDistance,
          FoundX, FoundY);
        if FoundY<0 then exit;
        PosX:= FoundX;
        PosY:= FoundY;
  