TextRangeTrackingMode Enum

Definition

Specifies the tracking modes for TextRange objects, which determine how spans of text are adjusted when text changes occur.

public enum TextRangeTrackingMode
type TextRangeTrackingMode = 
Public Enum TextRangeTrackingMode
Inheritance
TextRangeTrackingMode

Fields

Name Value Description
EdgeExclusive 0

The span does not expand when text changes occur at its boundaries.

Leading Edge-Forward tracking, meaning that insertions at the leading edge push the current position towards the end of the span.

  • Trailing Edge: Backward tracking, meaning that insertions at the trailing edge push the current position towards the start of the span.

             ┌──────────┐    
<strong>Baseline:</strong> Foo│ExtendNone│Bar 
             └──────────┘    
                   ┌─────────┐   
<strong>Remove leading:</strong> Foo│xtendNone│Bar
                   └─────────┘   
                    ┌─────────┐   
<strong>Remove trailing:</strong> Foo│ExtendNon│Bar
                    └─────────┘   
                       ┌──────────┐   
<strong>Insert leading:</strong> FooXXX│ExtendNone│Bar
                       └──────────┘   
                    ┌──────────┐   
<strong>Insert trailing:</strong> Foo│ExtendNone│XXXBar
                    └──────────┘   
ExtendNone 0

The span does not expand when text changes occur at its boundaries.

Leading Edge-Forward tracking, meaning that insertions at the leading edge push the current position towards the end of the span.

  • Trailing Edge: Backward tracking, meaning that insertions at the trailing edge push the current position towards the start of the span.

             ┌──────────┐    
<strong>Baseline:</strong> Foo│ExtendNone│Bar 
             └──────────┘    
                   ┌─────────┐   
<strong>Remove leading:</strong> Foo│xtendNone│Bar
                   └─────────┘   
                    ┌─────────┐   
<strong>Remove trailing:</strong> Foo│ExtendNon│Bar
                    └─────────┘   
                       ┌──────────┐   
<strong>Insert leading:</strong> FooXXX│ExtendNone│Bar
                       └──────────┘   
                    ┌──────────┐   
<strong>Insert trailing:</strong> Foo│ExtendNone│XXXBar
                    └──────────┘   
EdgeInclusive 1

The span expands when text changes occur at its boundaries.

Leading Edge-Backward tracking, meaning that insertions at the leading edge push the current position towards the start of the span.

  • Trailing Edge: Forward tracking, meaning that insertions at the trailing edge push the current position towards the end of the span.

             ┌────────────────────────┐    
<strong>Baseline:</strong> Foo│ExtendForwardAndBackward│Bar 
             └────────────────────────┘    
                   ┌───────────────────────┐   
<strong>Remove leading:</strong> Foo│xtendForwardAndBackward│Bar
                   └───────────────────────┘   
                    ┌───────────────────────┐   
<strong>Remove trailing:</strong> Foo│ExtendForwardAndBackwar│Bar
                    └───────────────────────┘   
                   ┌───────────────────────────┐   
<strong>Insert leading:</strong> Foo│XXXExtendForwardAndBackward│Bar
                   └───────────────────────────┘   
                    ┌───────────────────────────┐   
<strong>Insert trailing:</strong> Foo│ExtendForwardAndBackwardXXX│Bar
                    └───────────────────────────┘   
ExtendForwardAndBackward 1

The span expands when text changes occur at its boundaries.

Leading Edge-Backward tracking, meaning that insertions at the leading edge push the current position towards the start of the span.

  • Trailing Edge: Forward tracking, meaning that insertions at the trailing edge push the current position towards the end of the span.

             ┌────────────────────────┐    
<strong>Baseline:</strong> Foo│ExtendForwardAndBackward│Bar 
             └────────────────────────┘    
                   ┌───────────────────────┐   
<strong>Remove leading:</strong> Foo│xtendForwardAndBackward│Bar
                   └───────────────────────┘   
                    ┌───────────────────────┐   
<strong>Remove trailing:</strong> Foo│ExtendForwardAndBackwar│Bar
                    └───────────────────────┘   
                   ┌───────────────────────────┐   
<strong>Insert leading:</strong> Foo│XXXExtendForwardAndBackward│Bar
                   └───────────────────────────┘   
                    ┌───────────────────────────┐   
<strong>Insert trailing:</strong> Foo│ExtendForwardAndBackwardXXX│Bar
                    └───────────────────────────┘   
EdgePositive 2

Both edges of the span move towards the end when insertions occur.

Leading Edge-Forward tracking, meaning that insertions at the leading edge push the current position towards the end of the span.

  • Trailing Edge: Forward tracking, meaning that insertions at the trailing edge push the current position towards the end of the span.

             ┌─────────────┐    
<strong>Baseline:</strong> Foo│ExtendForward│Bar 
             └─────────────┘    
                   ┌────────────┐   
<strong>Remove leading:</strong> Foo│xtendForward│Bar
                   └────────────┘   
                    ┌────────────┐   
<strong>Remove trailing:</strong> Foo│ExtendForwar│Bar
                    └────────────┘   
                      ┌─────────────┐   
<strong>Insert leading:</strong> FooXXX│ExtendForward│Bar
                      └─────────────┘   
                    ┌────────────────┐   
<strong>Insert trailing:</strong> Foo│ExtendForwardXXX│Bar
                    └────────────────┘   
ExtendForward 2

Both edges of the span move towards the end when insertions occur.

Leading Edge-Forward tracking, meaning that insertions at the leading edge push the current position towards the end of the span.

  • Trailing Edge: Forward tracking, meaning that insertions at the trailing edge push the current position towards the end of the span.

             ┌─────────────┐    
<strong>Baseline:</strong> Foo│ExtendForward│Bar 
             └─────────────┘    
                   ┌────────────┐   
<strong>Remove leading:</strong> Foo│xtendForward│Bar
                   └────────────┘   
                    ┌────────────┐   
<strong>Remove trailing:</strong> Foo│ExtendForwar│Bar
                    └────────────┘   
                      ┌─────────────┐   
<strong>Insert leading:</strong> FooXXX│ExtendForward│Bar
                      └─────────────┘   
                    ┌────────────────┐   
<strong>Insert trailing:</strong> Foo│ExtendForwardXXX│Bar
                    └────────────────┘   
EdgeNegative 3

Both edges of the span move towards the start when insertions occur.

Leading Edge-Backward tracking, meaning that insertions at the leading edge push the current position towards the start of the span.

  • Trailing Edge: Backward tracking, meaning that insertions at the leading edge push the current position towards the start of the span.

             ┌──────────────┐    
<strong>Baseline:</strong> Foo│ExtendBackward│Bar 
             └──────────────┘    
                   ┌─────────────┐   
<strong>Remove leading:</strong> Foo│xtendBackward│Bar
                   └─────────────┘   
                    ┌─────────────┐   
<strong>Remove trailing:</strong> Foo│ExtendBackwar│Bar
                    └─────────────┘   
                   ┌─────────────────┐   
<strong>Insert leading:</strong> Foo│XXXExtendBackward│Bar
                   └─────────────────┘   
                    ┌──────────────┐   
<strong>Insert trailing:</strong> Foo│ExtendBackward│XXXBar
                    └──────────────┘   
ExtendBackward 3

Both edges of the span move towards the start when insertions occur.

Leading Edge-Backward tracking, meaning that insertions at the leading edge push the current position towards the start of the span.

  • Trailing Edge: Backward tracking, meaning that insertions at the leading edge push the current position towards the start of the span.

             ┌──────────────┐    
<strong>Baseline:</strong> Foo│ExtendBackward│Bar 
             └──────────────┘    
                   ┌─────────────┐   
<strong>Remove leading:</strong> Foo│xtendBackward│Bar
                   └─────────────┘   
                    ┌─────────────┐   
<strong>Remove trailing:</strong> Foo│ExtendBackwar│Bar
                    └─────────────┘   
                   ┌─────────────────┐   
<strong>Insert leading:</strong> Foo│XXXExtendBackward│Bar
                   └─────────────────┘   
                    ┌──────────────┐   
<strong>Insert trailing:</strong> Foo│ExtendBackward│XXXBar
                    └──────────────┘   
Custom 4

Custom client-determined tracking behavior.

Applies to