Altaveron - 2013-07-04

The issue may be fixed by the followind code.

Old code:

function TSynBaseCompletionProposalForm.CanResize(var NewWidth, NewHeight: Integer): Boolean;
var
  NewLinesInWindow: Integer;
  BorderWidth: Integer;
begin
  Result := True;
  case FDisplayKind of
  ctCode:
    begin
      BorderWidth := 2 * GetSystemMetrics(SM_CYSIZEFRAME);
      if FEffectiveItemHeight <> 0 then
      begin
        NewLinesInWindow := (NewHeight-FHeightBuffer) div FEffectiveItemHeight;
        if NewLinesInWindow < 1 then
          NewLinesInWindow := 1;
      end else
        NewLinesInWindow := 0;
      FLinesInWindow := NewLinesInWindow;
      NewHeight := FEffectiveItemHeight * FLinesInWindow + FHeightBuffer + BorderWidth;

New code:

function TSynBaseCompletionProposalForm.CanResize(var NewWidth, NewHeight: Integer): Boolean;
var
  NewLinesInWindow: Integer;
  BorderWidth: Integer;
  BorderHeight: Integer;
begin
  Result := True;
  case FDisplayKind of
  ctCode:
    begin
      BorderWidth := 2 * GetSystemMetrics(SM_CXSIZEFRAME);
      BorderHeight := 2 * GetSystemMetrics(SM_CYSIZEFRAME);
      if FEffectiveItemHeight <> 0 then
      begin
        NewLinesInWindow := (NewHeight - FHeightBuffer - BorderHeight) div FEffectiveItemHeight;
        if NewLinesInWindow < 1 then
          NewLinesInWindow := 1;
      end else
        NewLinesInWindow := 0;
      FLinesInWindow := NewLinesInWindow;
      NewHeight := FEffectiveItemHeight * FLinesInWindow + FHeightBuffer + BorderHeight;

Old code:

  procedure RecalcFormPlacement;
  var
    i: Integer;
    tmpWidth: Integer;
    tmpHeight: Integer;
    tmpX: Integer;
    tmpY: Integer;
    tmpStr: UnicodeString;
    BorderWidth: Integer;
    NewWidth: Integer;
  begin
    tmpX := x;
    tmpY := y;
    tmpWidth := 0;
    tmpHeight := 0;
    case Kind of
    ctCode:
      begin
        BorderWidth :=
          {$IFDEF SYN_CLX}
          6; // TODO: I don't know how to retrieve the border width in CLX
          {$ELSE}
          2 * GetSystemMetrics(SM_CYSIZEFRAME);
          {$ENDIF}
        tmpWidth := FWidth;
        tmpHeight := Form.FHeightBuffer + Form.FEffectiveItemHeight * FNbLinesInWindow + BorderWidth;
      end;

New code:

~~~~~~ procedure RecalcFormPlacement;
var
i: Integer;
tmpWidth: Integer;
tmpHeight: Integer;
tmpX: Integer;
tmpY: Integer;
tmpStr: UnicodeString;
BorderWidth: Integer;
BorderHeight: Integer;
NewWidth: Integer;
begin
tmpX := x;
tmpY := y;
tmpWidth := 0;
tmpHeight := 0;
case Kind of
ctCode:
begin
BorderWidth :=
{$IFDEF SYN_CLX}
6; // TODO: I don't know how to retrieve the border width in CLX
{$ELSE}
2 * GetSystemMetrics(SM_CXSIZEFRAME);
{$ENDIF}
BorderHeight :=
{$IFDEF SYN_CLX}
6; // TODO: I don't know how to retrieve the border width in CLX
{$ELSE}
2 * GetSystemMetrics(SM_CYSIZEFRAME);
{$ENDIF}
tmpWidth := FWidth;
tmpHeight := Form.FHeightBuffer + Form.FEffectiveItemHeight * FNbLinesInWindow + BorderHeight;
end;
~~~~~~