microsoft / RTVS

R Tools for Visual Studio.
MIT License
389 stars 118 forks source link

Brace completion highlighting fails after using the scrollbar preview tooltip #4279

Open mhmdmodan opened 6 years ago

mhmdmodan commented 6 years ago

What I mean by brace completion highlighting is the highlighted curly braces below. When moving the cursor to a brace, the matching pair will become highlighted, as shown:

image

This works fine, unless "Use map mode for vertical scrollbar" AND "Show Preview Tooltip" is enabled under Scroll Bar Options (just map mode without tooltip does not produce the error). Brace completion highlighting will work if the option is selected, but as soon as you put your mouse over the scrollbar to initiate the preview tooltip (as shown below):

image

Brace completion highlighting will stop working until the file is reopened, as seen in the following screenshot. The caret has moved to new braces, but they are not highlighted anymore:

image

Interestingly, dragging/hovering the mouse over a section of the scrollbar with no code (ie, no preview tooltip will appear) does not disable the highlighting.

To reproduce:

  1. Right click the scrollbar, select "Scrollbar Options"
  2. Enable "Use map mode for vertical scrollbar" AND "Show preview tooltip"

image

  1. Brace highlighting will work as expected.
  2. Hover over a region of code in the scrollbar to bring up the preview tooltip.
  3. Brace highlighting stops working until file reopened.

Attempted to reproduce this in a Visual C# class, but it works correctly there, which led me to believe it's specific to RTVS. Interestingly, brace highlighting shows in the tooltip for C# but not in R, might have to do with the issue?

image