Using Text Markers with the Legacy API
A text marker is a floating range of text in a buffer that can affect the display and behavior of a region of text. Markers include breakpoints, bookmarks, wavy underlines, and read-only regions. Text markers are basically different from syntax coloring. Syntax coloring is a quick way to communicate the language syntax that is associated with a region of text. Syntax coloring is generally requested when Windows repaints the screen, when speed is important. Syntax coloring changes only the color of text. Text markers can change many other text properties. Text markers can "float" and apply special behavior and coloring.
Because of the performance overhead associated with text markers, do not create many markers for your text buffers. Each marker is updated every time that a user edits the buffer contents.
注意
Users can change the color of a visible marker type but not its shape and style. For more information, see Fonts and Colors, Environment, Options Dialog Box.
Related Topics
Title |
Description |
---|---|
Describes how to add a standard text marker type provided by the Visual Studio core editor to a text view. |
|
Describes how to implement an instance of the Visual Studio marker that is used to indicate errors by using red wavy underlines. |
|
Describes how to create and add a custom text marker type to a text view. |
|
Explains how to add text markers. |
|
Describes the features of the core editor and provides details about how to customize the core editor. |
|
Describes the features available in the Visual Studio core editor. |
Reference
IVsPackageDefinedTextMarkerType
Provides a uniform mechanism for obtaining information about a specific text marker type, whether predefined by the editor or registered by a VSPackage.IVsTextLineMarker
Provides access to and adjusts the position of a text marker in a text buffer by using two-dimensional coordinates.IVsTextMarker
Provides methods for managing text markers.IVsTextMarkerClient
Provides callbacks to the Visual Studio IDE and other processes that are used to adjust a text marker.IVsTextMarkerClientAdvanced
Extends the functionality that is available through the IVsTextMarkerClient interface by providing additional callbacks.IVsTextMarkerClientEx
Extends the functionality that is available through the IVsTextMarkerClient interface by providing additional callbacks.IVsTextMarkerColorSet
Enables a marker type to determine whether other marker types share the same set of colors.IVsTextMarkerContextProvider
Provides context for text markers in the core editor. For each text marker type that is in the core editor, the IDE creates a separate IVsTextMarkerContextProvider object.IVsTextMarkerGlyphDropHandler
A handler that is provided for markers whose glyphs support drag-and-drop editing. A glyph is an icon that indicates the position of a marker.IVsTextMarkerTypeProvider
Returns an IVsPackageDefinedTextMarkerType interface from a service that provides a text markers to other VSPackages.IVsTextStreamMarker
Provides access to and adjusts the position of a text marker in a text buffer by using one-dimensional coordinates. If it is possible, do not use this interface.