public GetVirtualIndentationColumn ( Mono.TextEditor.DocumentLocation loc ) : int | ||
loc | Mono.TextEditor.DocumentLocation | |
return | int |
using Mono.TextEditor; TextEditorData editorData = new TextEditorData(); int nextIndentation = editorData.GetVirtualIndentationColumn(2); // 8
using Mono.TextEditor; TextEditorData editorData = new TextEditorData(); int nextIndentation = editorData.GetVirtualIndentationColumn(2); // 8 editorData.InsertAtCursor("\n" + new string(' ', nextIndentation), false); // Inserts a newline and spaces with the same indentation level as the next lineIn this example, we again create a new TextEditorData instance and call the GetVirtualIndentationColumn method with the line number 2 to get the next indentation level. We then use this indentation level to insert a new line at the cursor position with the same indentation level.
public GetVirtualIndentationColumn ( Mono.TextEditor.DocumentLocation loc ) : int | ||
loc | Mono.TextEditor.DocumentLocation | |
return | int |