IVsLanguageLineIndent Interface


Determines the number of "spaces" that should be added to the beginning of the specified line.

Namespace:   Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)

public interface IVsLanguageLineIndent

System_CAPS_pubmethodGetIndentPosition(IVsTextLayer, Int32, Int32)

Determines how many "spaces" to add at the start of a line.

Typically used by the core editor or editor emulators such as Emacs, this interface is used to support "smart" indenting and determines where to position the caret after the user types Enter to insert a new line.

Notes to Implementers:

This interface is implemented on the same object that implements the IVsLanguageTextOps interface. Implement the IVsLanguageLineIndent interface if you need precise control over where the caret is to be positioned on a new line. For example, if the user types Enter after an open brace in C++ or C#, a new line is entered and the caret is positioned one tab stop in relative to the open brace.

Notes to Callers:

Obtain this interface from the IVsLanguageTextOps interface by calling the QueryInterface method (C++) or by casting the IVsLanguageTextOps interface to an IVsLanguageLineIndent interface (C#, Visual Basic). Typically this interface is looked for only if the indenting style is set to vsIndentStyleSmart. If this interface cannot be obtained, use other methods to simulate smart indenting.

Return to top