Mono.TextEditor.TextEditorData.GetVirtualIndentationColumn C# (CSharp) Method

GetVirtualIndentationColumn() public method

public GetVirtualIndentationColumn ( Mono.TextEditor.DocumentLocation loc ) : int
loc Mono.TextEditor.DocumentLocation
return int
		public int GetVirtualIndentationColumn (DocumentLocation loc)
		{
			return IndentationTracker.GetVirtualIndentationColumn (loc.Line, loc.Column);
		}
		

Same methods

TextEditorData::GetVirtualIndentationColumn ( int offset ) : int
TextEditorData::GetVirtualIndentationColumn ( int lineNumber, int column ) : int

Usage Example

        public static void Right(TextEditorData data)
        {
            if (Platform.IsMac && data.IsSomethingSelected && !data.Caret.PreserveSelection)
            {
                data.Caret.Offset = System.Math.Max(data.SelectionAnchor, data.Caret.Offset);
                data.ClearSelection();
                return;
            }

            DocumentLine line = data.Document.GetLine(data.Caret.Line);
            IEnumerable <FoldSegment> foldings = data.Document.GetStartFoldings(line);
            FoldSegment segment = null;

            foreach (FoldSegment folding in foldings)
            {
                if (folding.IsFolded && folding.Column == data.Caret.Column)
                {
                    segment = folding;
                    break;
                }
            }
            if (segment != null)
            {
                data.Caret.Offset = segment.EndOffset;
                return;
            }

            if (data.Caret.Column >= line.Length + 1)
            {
                int nextColumn;
                if (data.HasIndentationTracker && data.Options.IndentStyle == IndentStyle.Virtual && data.Caret.Column == DocumentLocation.MinColumn)
                {
                    nextColumn = data.GetVirtualIndentationColumn(data.Caret.Location);
                }
                else if (data.Caret.AllowCaretBehindLineEnd)
                {
                    nextColumn = data.Caret.Column + 1;
                }
                else
                {
                    nextColumn = line.Length + 1;
                }

                if (data.Caret.Column < nextColumn)
                {
                    data.Caret.Column = nextColumn;
                }
                else
                {
                    if (data.Caret.Line < data.LineCount)
                    {
                        data.Caret.Location = new DocumentLocation(data.Caret.Line + 1, DocumentLocation.MinColumn);
                    }
                }
            }
            else
            {
                data.Caret.Column++;
            }
        }
All Usage Examples Of Mono.TextEditor.TextEditorData::GetVirtualIndentationColumn