You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But because the html view doesn't retain its scroll position, if you set the initial line to X with the above script, the following happens.
Scroll the annotation view (to line Y)
Switch to another document
Switch back to the annotation view, you are not at line Y but X.
Although it's not great, I think it's better to always show at the top of the annotation view rather than to show at line X which I would probably forget by the time I switch back to the view and would then get confused why I'm seeing the line X.
It happens with Markdown Preview page as well. If I leave and come back to the preview, scroll position goes back to the page top. It retains the scroll position if you open the preview along with the markdown editor. I need to check if it's intended/ideal behaviour in vscode issues.
But because the html view doesn't retain its scroll position, if you set the initial line to X with the above script, the following happens.
Scroll the annotation view (to line Y)
Switch to another document
Switch back to the annotation view, you are not at line Y but X.
...
It happens with Markdown Preview page as well. If I leave and come back to the preview, scroll position goes back to the page top. It retains the scroll position if you open the preview along with the markdown editor. I need to check if it's intended/ideal behaviour in vscode issues.
This is fixed in VS Code 1.21! So the original request can be implemented.
Activity
ryu1kn commentedon Jul 15, 2016
Yeah it would be nice if we have this especially when you work on a large file.
ryu1kn commentedon Aug 8, 2016
If I add this in the html, I can open annotation view already scrolled to the specified
lineNumber
.But because the html view doesn't retain its scroll position, if you set the initial line to
X
with the above script, the following happens.Y
)Y
butX
.Although it's not great, I think it's better to always show at the top of the annotation view rather than to show at line
X
which I would probably forget by the time I switch back to the view and would then get confused why I'm seeing the lineX
.It happens with Markdown Preview page as well. If I leave and come back to the preview, scroll position goes back to the page top. It retains the scroll position if you open the preview along with the markdown editor. I need to check if it's intended/ideal behaviour in vscode issues.
ryu1kn commentedon Aug 8, 2016
By the way, at this timing, the
window.scrollTo(
gets executed twice.isg commentedon Aug 19, 2016
Yeah this would be super useful (and thanks for the great extension as is!)
ryu1kn commentedon Mar 8, 2018
This is fixed in VS Code 1.21! So the original request can be implemented.
ctf0 commentedon Aug 31, 2020
@ryu1kn any updates on this ?