oleg-shilo / PyMap.VSIX

CodeMap extension for Visual Studio 2017-2022
18 stars 3 forks source link

Horizontal Scroll Jumps on Document Load #13

Closed bfarrall closed 5 months ago

bfarrall commented 5 months ago

Methods in the codemap now show the list of parameters, but now what can happen is the scroll bar will jump to display the end of a method parameter list for the last selected method in the class.

Steps:

oleg-shilo commented 5 months ago

Can you help me to reproduce it?

The steps you provided do not seem to trigger the problem. Maybe something is missing in the steps.... But after switching between classes I do not see h-scrollbar changing its position.

capture

bfarrall commented 5 months ago

In my situation I had methods with quite long signatures. Some more than 10 (don't ask). It seemed to only happen for those extra long ones.

oleg-shilo commented 5 months ago

Done.

This problem happens only if the vertical scrollbar is visible and not at the 0 position. The problem itself is the intended behaviour implemented by ListBox. Though it is not convenient for our use case. Thus now I am changing the H-scroll position on selection change to most-left.

bfarrall commented 5 months ago

Interesting to hear the issue I can see why the listbox would need such a mechanic. The latest fix for the codemap looks like it corrected the issue for me. Thanks!

oleg-shilo commented 5 months ago

... I can see why the listbox would need such a mechanic.

Yes, I cannot say that it is wrong. The developer asks ListBox to show the selection, but the selection does not fit the visible area. Which part selection to show? Does not what you decide to show, there will be cases when your decision will not give the user the best UI (our case).

BTW, the same applies to the "show selection" in the TexBox API. Is it the selection start or the end? :o)