Debugger: Improved scroll position for code preview

This commit is contained in:
Sour 2018-01-02 13:10:24 -05:00
parent 7debc4e98c
commit c1df2c92dd

View file

@ -381,13 +381,9 @@ namespace Mesen.GUI.Debugger
while(scrollPos > 0 && _lineNumbers[scrollPos - 1] < 0) {
//Make sure any comment for the line is in scroll view
scrollPos--;
if(_contents[scrollPos].StartsWith("--")) {
if(_contents[scrollPos].StartsWith("--") || _contents[scrollPos].StartsWith("__")) {
//Reached the start of a block, stop going back up
break;
} else if(_contents[scrollPos].StartsWith("__")) {
//Reached the end of a block, go back down 1 line and stop
scrollPos++;
break;
}
}
this.ScrollPosition = scrollPos;