FastColoredTextBoxNS.FindForm.NextPlace C# (CSharp) Method

NextPlace() private method

private NextPlace ( Place p ) : Place
p Place
return Place
        private Place NextPlace(Place p)
        {
            int lineLength = tb.GetLineLength(p.iLine);
            if (p.iChar < lineLength - 1)
            {
                return new Place(p.iChar+1, p.iLine);
            }
            else
            {
                // place is at last character of the line
                if (p.iLine < tb.LinesCount - 1)
                {
                    // move to next line
                    return new Place(0, p.iLine + 1);
                }
                else
                {
                    // already at last line, move to first line
                    return new Place(0,0);
                }

            }
        }