Alsing.Windows.Forms.SyntaxBox.Caret.MoveLeft C# (CSharp) Method

MoveLeft() public method

Moves the caret left one step. if the caret is placed at the first column the caret will be moved up one line and placed at the last column of the row.
public MoveLeft ( bool Select ) : void
Select bool True if a selection should be created from the current caret pos to the new pos
return void
        public void MoveLeft(bool Select)
        {
            CropPosition();
            Position.X--;

            if (CurrentRow.IsCollapsedEndPart)
            {
                if (Position.X < CurrentRow.Expansion_StartChar)
                {
                    if (CurrentRow.Expansion_StartRow.Index == - 1)
                        Debugger.Break();
                    Position.Y = CurrentRow.Expansion_StartRow.Index;
                    Position.X = CurrentRow.Expansion_StartRow.Expansion_EndChar;
                    CropPosition();
                }
                RememberXPos();
                CaretMoved(Select);
            }
            else
            {
                if (Position.X < 0)
                {
                    if (Position.Y > 0)
                    {
                        MoveUp(Select);
                        CropPosition();
                        Row xtr = CurrentRow;
                        Position.X = xtr.Text.Length;
                        if (CurrentRow.IsCollapsed)
                        {
                            Position.Y = CurrentRow.Expansion_EndRow.Index;
                            Position.X = CurrentRow.Text.Length;
                        }
                    }
                    else
                        CropPosition();
                }
                RememberXPos();
                CaretMoved(Select);
            }
        }