Compartilhar via


ViewFilter.HandleSmartIndent Method

Definition

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.

Applies to