private void AdjustStartOfFunctionIfAppropriate(ScriptFunction func, int currentPos, int adjustment)
{
if (func.StartsAtCharacterIndex > currentPos)
{
func.StartsAtCharacterIndex += adjustment;
}
if (func.EndsAtCharacterIndex > currentPos)
{
func.EndsAtCharacterIndex += adjustment;
}
if (func.StartsAtCharacterIndex < 0)
{
// Function has probably just been deleted
func.StartsAtCharacterIndex = -1;
func.EndsAtCharacterIndex = -1;
}
}