ViewFilter.HandleSmartIndent Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Handles smart indentation.
public:
virtual bool HandleSmartIndent();
public:
virtual bool HandleSmartIndent();
virtual bool HandleSmartIndent();
public virtual bool HandleSmartIndent ();
abstract member HandleSmartIndent : unit -> bool
override this.HandleSmartIndent : unit -> bool
Public Overridable Function HandleSmartIndent () As Boolean
Returns
Returns true
if the caret position has changed as a result of smart indentation. Returns false
if no changes have been made to the source.
Remarks
This method handles the task of reformatting a section of code in response to the Enter key. This could be as simple as moving the caret to the next line, taking into account the current indent level or as complex as fixing the indent level for the contents of a matching triplet (for example, "if
", "{", and "}
") when the Enter key is pressed after the closing element.
The base method does nothing and returns false
.
In the default managed package framework's implementation of the language service classes, this method is called from the HandlePreExec method in response to the RETURN command but only if the IndentStyle property is set to Smart.