ecSyntMemo

//AT: changed some ifs
function TCustomSyntaxMemo.GetSelectedLines(var FirstLine, LastLine: integer): integer;
begin
  if HaveSelection and (SelectMode = msColumn) then
   begin
     FirstLine := FBlock.Top;
     LastLine := FBlock.Bottom;
   end else
  if FSelLength > 0 then 
  begin
     FirstLine := StrPosToCaretPos(FSelStart).Y;
     with StrPosToCaretPos(FSelStart + FSelLength) do
      if (X = 0) and (Y > 0) then
       LastLine := Y - 1
      else
       LastLine := Y;
     if LastLine < FirstLine then
       LastLine := FirstLine;
  end
  else
  begin
    FirstLine := FCaretPos.Y;
    LastLine := FirstLine;
  end;
  Result := LastLine - FirstLine + 1;
end;


procedure TCustomSyntaxMemo.IntSetSelection
//at start add
  //AT
  //need to enable "normal" set selection for "columns" mode for 2 cases:
  //a) select all, b) select current word by dbl-click
  if SelectMode=msColumn then
    if ((sStart=0) and (sLength=TextLength)) or
      (StrPosToCaretPos(sStart).Y = StrPosToCaretPos(sStart+sLength).Y) then
    begin
      SelectMode := msNormal;
    end;


procedure TCustomSyntaxMemo.StartTextSelection
//in ending case add:
  case SelectMode of
    msColumn: ExecCommand(smColSelGotoXY, {$IFNDEF EC_DOTNET}@{$ENDIF}pt);
    msNone:   ExecCommand(smGotoXY, {$IFNDEF EC_DOTNET}@{$ENDIF}pt);
    msLine:   begin end; //AT - fix for non-activated Line sel mode
    else      ExecCommand(smSelGotoXY, {$IFNDEF EC_DOTNET}@{$ENDIF}pt);
  end;
