Highlight words on select only

Aug 8, 2013 at 2:57 PM
Thanks for sharing these extensions! Really, really useful. They brings Ax code editor one step closer to being a professional grade tool.
After using it for a while I noticed that the automatic highlight puts some additional strain on my eyes. First, because a cursor becomes not clearly visible in darker background of a highlighted word. Second, because of a highlight 'flicker' happening here and there when the cursor travels across the source.
I think, it would be better from the usability point of view if it would activate only on selected parts of the source, like the Notepad++ does.

Jan 17, 2014 at 5:44 PM
You can do that by modifying the code and recompiling your own version of the DLL. Here is how I did it:
In method HighlightWordTagger() i removed the line
this.View.Caret.PositionChanged += CaretPositionChanged; 
and replaced it with
this.View.Selection.SelectionChanged += new EventHandler(SelectionChanged);
then I added this method:
void SelectionChanged(object sender, EventArgs e)
    TextExtent word;

    if (View.Selection.SelectedSpans[0].IsEmpty)
        SynchronousUpdate(RequestedPoint, new NormalizedSnapshotSpanCollection(), null);

    if (View.Selection.SelectedSpans.Count == 1)
        word = TextStructureNavigator.GetExtentOfWord(View.Selection.Start.Position);

        if (word.Span.Equals(View.Selection.SelectedSpans[0]))
            RequestedPoint = View.Selection.Start.Position;
Feb 2, 2015 at 9:51 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.