anchor.diff:                  CtrlKeyLeftKey
                 else
                   FSelEndOffs := CaretPos.X;
  -              if FSelEndNo <= pred(FLines.Count) then
  +              if FSelEndNo <= (FLines.Count-1) then
                 begin
  -                if FSelEndOffs > Length(FLines[FSelEndNo]) then
  +                if FSelEndOffs > UTF8Length(FLines[FSelEndNo]) then
                   begin
  -                  FSelEndOffs := Length(FLines[FSelEndNo]) - 1;
  +                  FSelEndOffs := UTF8Length(FLines[FSelEndNo]) - 1;
                     CaretPos.X := FSelEndOffs;
                   end;
                 end
  
positive.code:     FVisCols := GetClientRect.Width div FChrW;
  end;
  
  procedure TfpgBaseTextEdit.GetSelBounds(var AStartNo, AEndNo, AStartOffs,
    AEndOffs: Integer);
  begin
  
negative.code:           begin
              if CaretPos.Y > 0 then
              begin
                if CaretPos.Y <= (FLines.Count-1) then
                begin
                  if (ssCtrl in ShiftState) and (CaretPos.Y > 0) then
                  begin
                    CaretPos.Y := CaretPos.Y - 1;
                    CaretPos.X := UTF8Length(FLines[CaretPos.Y]);
                    if FSelected then
                    begin
                      FSelEndNo := CaretPos.Y;
  