Skip to content

Keep and restore scroll position for readonly documents #22420

Closed

Description

@roblourens
  • Start legacy protocol debug session
  • Open something via "Open loaded scripts"
  • scroll down
  • ctrl+tab to switch to another doc
  • ctrl+tab back to the newly opened script

It's scrolled up to the top. Is it being closed/opened each time we switch away?

Activity

  1. added
    debug
    on Mar 13, 2017
  2. weinand commented on Mar 29, 2017

    @weinand
    Contributor

    This problem is independent from the "Open Loaded Scripts" feature.

    To reproduce:

    • debug a simple node hello world program and stop on entry
    • in the CALL STACK select an internal module
    • press Control-Tab twice (to switch between two editors)

    Observe: you loose the scroll position in the internal module

  3. isidorn commented on Mar 29, 2017

    @isidorn

    March to investigate

  4. isidorn commented on Mar 29, 2017

    @isidorn

    Workbench is not preserving scroll location of in memory resources.
    Same is true for diff view.

    Forwarding to Benjamin Pasero (@bpasero) since he probably already has an issue for this

  5. removed this from the March 2017 milestone on Mar 29, 2017
  6. added and removed
    debug
    on Mar 29, 2017
  7. 5 remaining items

  8. isidorn commented on Mar 29, 2017

    @isidorn

    Benjamin Pasero (@bpasero) give me some code pointers for the PR and I can do it in debt week

  9. bpasero commented on Mar 29, 2017

    @bpasero
    Contributor

    Isidor Nikolic (@isidorn) we do it for files and untitled via the saveTextEditorViewState and restoreTextEditorViewState methods that are actually defined in src/vs/workbench/browser/parts/editor/textEditor and we could probably push this down from resourceTextEditor and textFileEditor and just use it from textEditor for any input that has a resource 👍

  10. isidorn commented on Mar 29, 2017

    @isidorn

    Ok, makes sense. Assigning to me and April to look into it

  11. added
    debug
    on Apr 5, 2017
  12. soncodi commented on May 9, 2017

    @soncodi
    Contributor

    Related: #26251

  13. bpasero commented on May 9, 2017

    @bpasero
    Contributor

    With #26317 landed, we keep the UI state when you switch editors, though we clear it when you close a tab. The rationale is that the lifecycle of these editors that have virtual resources is not known, as such we assume the view state can be ditched once the editor closes.

  14. added
    verification-needed
    on May 9, 2017
  15. eamodio commented on May 9, 2017

    @eamodio
    Contributor

    That sounds perfect!

  16. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

debugfeature-requesthelp wantedverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions