Search code examples
sqlvisual-studioselection

Cursor bug when editing sql file


I came across a problem in Visual Studio Enterprise 16.9.6, when editing an sql script the cursor just goes crazy, when I try to select a line in the file or the navigation bar it just selects files from the solution explorer or whatever sidebar is there, even if no sidebar is present, it just makes it impossible to work on them. With any other file this doesn't happen, only sql files.

It's best to show rather than describe:

enter image description here

Even stranger than that is the fact that it only happens on a secondary screen, on the primary screen everyting works fine.

Anyone had this issue? Any advice?


Solution

  • I was able to pinpoint the issue, as my laptop screen is 15,6", a bit small, I had the scale at 125%, whereas the secondary screen was at 100%, putting the primary screen back to 100% makes the problem go away. I imagine that putting the secondary to 125% would also fix it, though I didn't try that. It's the difference between screen scaling that makes the bug manifest itself, it appears that the primary screen is the one used to define the editor window size and that is then used in secondary screens for the cursor area.

    I decided to leave an answer because I saw some people with the same issue and some bug reports, though none of them was able to find the source of the problem, for that reason I also decided to leave a bug report of my own:

    Bug report