anchor.diff:      NLine:= Props[iCaret].NLine;
       XOpen:= Props[iCaret].XOpen;
       XClose:= Props[iCaret].XClose;
  -
  -    if NLine<0 then exit;
  -    if XOpen<0 then exit;
  -    if XClose<0 then exit;
   
       Str:= St.Lines[NLine];
       Delete(Str, XClose, 1);
  
positive.code:       begin
          CharPrev:= Str[Caret.PosX];
          if Pos(CharPrev, Ed.OptAutoPairChars)=0 then
            exit;
  
          CharNext:= EditorBracket_GetPairForOpeningBracketOrQuote(CharPrev);
          if CharNext=#0 then
            exit;
  
          X:= Caret.PosX+1;
          while (X<=Length(Str)) and IsCharSpace(Str[X]) do
            Inc(X);
          if not ((X<=Length(Str)) and (Str[X]=CharNext)) then
            exit;
  
          Props[iCaret].NLine:= Caret.PosY;
          Props[iCaret].XOpen:= Caret.PosX;
          Props[iCaret].XClose:= X;
        end
        else
          exit;
      end
      else
        exit;
    end;
  
    //all carets have 'good situation', delete pair brackets
  
negative.code: begin
    Result:= false;
    St:= Ed.Strings;
    SetLength(Props, Ed.Carets.Count);
  
    //first scan all carets, and check each caret has the situation "(|  )"
    for iCaret:= Ed.Carets.Count-1 downto 0 do
    begin
      Props[iCaret].NLine:= -1;
  