C# Class Microsoft.R.Editor.Selection.RSelectionTracker

JScript selection tracker. Helps preserve selection and correct caret position during script autoformatting. Uses tokenizer to calculate where caret should be after autoatic formatting.
Inheritance: Microsoft.Languages.Editor.Selection.SelectionTracker
Show file Open project: Microsoft/RTVS Class Usage Examples

Public Methods

Method Description
EndTracking ( ) : void

Restores saved selection

RSelectionTracker ( ITextView textView, ITextBuffer textBuffer, ITextRange changingRange ) : System

SelectionTracker constructor

StartTracking ( bool automaticTracking ) : void

Saves current selection

Private Methods

Method Description
PositionFromTokens ( ITextSnapshot snapshot, int itemIndex, int offset ) : int
TokenFromPosition ( ITextSnapshot snapshot, int position, int &itemIndex, int &offset ) : void

Method Details

EndTracking() public method

Restores saved selection
public EndTracking ( ) : void
return void

RSelectionTracker() public method

SelectionTracker constructor
public RSelectionTracker ( ITextView textView, ITextBuffer textBuffer, ITextRange changingRange ) : System
textView ITextView Text view
textBuffer ITextBuffer Editor text buffer (may be different from one attached to text view)
changingRange ITextRange Range that is changing in the buffer
return System

StartTracking() public method

Saves current selection
public StartTracking ( bool automaticTracking ) : void
automaticTracking bool
return void