Hello, I am working on feature for Visual Studio 2010+ where I need to show provisional (planned) selection.
I tried multiple ways using Markers, Taggers and ClassificationFormat and so on,
but those markers do not work correctly for me when they include linebreaks.
All what I need is to somehow show to user a transient block representing a new selection.
But without changing of current selection as it is too slow on large blocks (10k+ lines of code).
Selection also moves caret which is not wanted.
Colleague pointed me to ITextView.ProvisionalTextHighlight property of type ITrackingSpan,
but he also discovered the issue described below.
I tried to use it as:
var span = _buffer.CurrentSnapshot.CreateTrackingSpan(e.Pos, e.Length, SpanTrackingMode.EdgeExclusive); _textView.ProvisionalTextHighlight = span;
It works perfectly, but a highlighted text is blinking in caret time interval.
What would you suggest to use for selection preview in VS2010+ ?
In other words, how do I show ITrackingSpan in same colors and form as editor selection does?
Thanks in advance.