public void CharRight(int i)
{
if (i < 0)
{
CharLeft(-i);
return;
}
while (i>0)
{
int shiftsToGo = this.LineLength - mCharPosition;
if ( i <= shiftsToGo )
{
mCharPosition += i;
i=0;
}
else
{
i -= shiftsToGo;
if (mLineNum == mParent.GetNumberLines())
{
mCharPosition = this.LineLength;
return;
}
else
{
mLineNum++;
mCharPosition=0;
i--;// the carriage return moves to the start of the next line
}
}
}
}