Skip to content

Ability to switch to previous behavior on 1.52.0 'Preview editor improvements' #112348

Closed

Description

@ssoher

With the November 2020 update, code navigation options do not open the navigated file in the same editor even when the current editor is in the preview mode. This quickly litters the workbench with a ton of editors when I want to drill down inheritance trees for example. If I want the navigation target to open in a new editor I can quickly get out of the preview mode with a command like save and then navigate so I don't understand the need for this change. I was able to use the Go->Back command to go to the previous editor in the preview mode already so I never lost track of where I have navigated from and this way the workbench is not littered with a ton of editors I'm not interested in. It really goes against the nature of "preview mode" in my opinion.

So my request it, please make it toggleable, I want the old behavior back. By old behavior I mean if the current editor is in preview mode and I navigate from it with commands like go to definition, open the definition file in the same editor in preview mode.

Activity

  1. gjsjohnmurray commented on Dec 12, 2020

    @gjsjohnmurray
    Contributor
  2. bpasero commented on Dec 12, 2020

    @bpasero
    Contributor

    This seems like a fair request to me with a new option such as workbench.editor.enablePreviewFromCodeNavigation. Open for grab if someone wants to contribute a PR, the change needs to go somewhere here:

    // Special case: we want to detect the request to open an editor that
    // is different from the current one to decide wether the current editor
    // should be pinned or not. This ensures that the source of a navigation
    // is not being replaced by the target. An example is "Goto definition"
    // that otherwise would replace the editor everytime the user navigates.
    if (
    source && // we need to know the origin of the navigation
    !input.options?.pinned && // we only need to look at preview editors that open
    !sideBySide && // we only need to care if editor opens in same group
    !isEqual(source.getModel()?.uri, input.resource) // we only need to do this if the editor is about to change
    ) {
    for (const visiblePane of this.editorService.visibleEditorPanes) {
    if (getCodeEditor(visiblePane.getControl()) === source) {
    visiblePane.group.pinEditor();
    break;
    }
    }
    }

  3. added
    feature-request
    workbench-editors
    help wanted
    on Dec 12, 2020
  4. vscode-triage-bot commented on Dec 12, 2020

    @vscode-triage-bot

    This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

    Happy Coding!

  5. cateyes99 commented on Dec 12, 2020

    @cateyes99

    To be honest, this change is silly it causes so much inconvenience. If it's in preview editor mode, it isn't hard for someone to make it in normal editor mode first and then navigate to another one, if they really want. Now as this issue mentioned: This quickly litters the workbench with a ton of editors when I want to drill down inheritance trees for example. IMHO, it's should be roll back, or if add a new option to control this behaviour then the old behaviour should be the default one.

  6. ssoher commented on Dec 12, 2020

    @ssoher
    Author

    cateyes99 agreed. why is there a preview mode in the first place if it's going to behave the same with non-preview editors. with this change the preview mode became inconsistent with no added benefit that I can think of.

  7. bpasero commented on Dec 12, 2020

    @bpasero
    Contributor

    At least we in the team believe this to be a good change, and it was discussed in our UX meetings. We argue that it is equally confusing that an editor is replaced by the editor you are navigating to and as such you are not building up a history of navigation because all the editors open in the same location. Now, you have a trace of editors you navigated to. And the one you navigate to is opening in preview mode, so you only end up with more editors if you continue navigation.

  8. ssoher commented on Dec 12, 2020

    @ssoher
    Author

    Benjamin Pasero (@bpasero) I understand the reasoning but fail to see how turning my preview editor into a normal editor when I use go-to (which is a strange side effect) and make the preview editor behave exactly the same with a normal editor in this aspect is a better way to handle it. In the previous versions users could disable the preview editors all together or simply convert them to normal editors with a simple keyboard shortcut to achieve what is the only default now.

  9. bpasero commented on Dec 12, 2020

    @bpasero
    Contributor

    Yup I understand and I am happy to hear from users so that we can tweak this experience. As I said before, I am all up for a new setting to control this.

  10. 17 remaining items

  11. added
    verification-needed
    on Dec 15, 2020
  12. bpasero commented on Dec 15, 2020

    @bpasero
    Contributor

    A new setting enablePreviewFromCodeNavigation allows to configure this.

  13. added
    author-verification-requested
    on Dec 16, 2020
  14. added
    insiders-released
    and removed
    unreleased
    on Dec 16, 2020
  15. vscode-triage-bot commented on Dec 16, 2020

    @vscode-triage-bot

    This bug has been fixed in to the latest release of VS Code Insiders!

    Sarper Soher (@ssoher), you can help us out by commenting /verified if things are now working as expected.

    If things still don't seem right, please ensure you're on version 2f8dee4 of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

    Happy Coding!

  16. ssoher commented on Dec 19, 2020

    @ssoher
    Author

    /verified

  17. added
    on-release-notes
    on Jan 23, 2021
  18. locked and limited conversation to collaborators on Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requesthelp wantedinsiders-releasedon-release-notesuxverification-neededverifiedworkbench-editors

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions