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
{{ message }}
Repository navigation
Diff tabs opened from the Source Control panel no longer in preview mode #26184
3.a Stay on the editor of A.cs, and click the button of Open Changes on the top right corner above the editor.
4.a A diff tab opened to show the difference between the changed A.cs and the version in GitHub. Before version 1.12, this diff tab will be open in the preview mode (the tab title font is in italic), now the new diff tab is just a normal tab.
3.b Open the Source Control panel, click A.cs.
4.b A diff tab opened to show the difference between the changed A.cs and the version in GitHub. Before version 1.12, this diff tab will be open in the preview mode (the tab title font is in italic), now the new diff tab is just a normal tab.
If I have 50 files changed, and iterate the changes in the 50 files from Source Control panel, it will open 50 diff tabs for me! This new behaviour isn't very desired. The old behaviour in the previous versions is much more convenient and consistent with opening files from the Explorer panel.
Reacted by Glen, Oliver Bambrough, Dinesh Bogolu, Maxim, Ernesto Ramirez, Michel Makarios, scottclayton, Ian Lin, Theodore Tsirpanis, acceptable and 7 more
changed the title [-]Diff tabs opened from `Source Control` no longer in preview mode[/-][+]Diff tabs opened from the `Source Control` panel no longer in preview mode[/+]on May 8, 2017
This was to align the behaviour of our various open-calls. João Moreno (@joaomoreno) you do have an option tho, simply set preview to true and everything is back to normal
I think the extension should not decide to set the preview flag unless it really wants to make sure that something does not open as preview (e.g. a use case I can see is to open a playground to the side of the current editor that should not go away too easily).
The workbench should deal with the preview flag, otherwise settings like "workbench.editor.enablePreview": false are ignored, which is bad.
Johannes Rieken (@jrieken) I have set "workbench.editor.enablePreview": true in user settings but no luck. Is there any other setting to be set explicitly?
This isn't about the setting Dinesh Bogolu (@bdinesh). Foremost extensions can express their intent when showing a text document (preview or not). Unsure how the setting plays into that, but I have a feeling that the editor service should use it and simply overrule the API choice. Correct Benjamin Pasero (@bpasero) or are there editors that must open as preview despite have that setting which blocks putting this into the service?
If these settings are configured by default, in most cases we open files in preview (e.g. click in explorer, open from quick open).
However, there are still some user interactions that can lead to not using preview after all independent from the setting:
double click in the explorer
opening a dirty file
moving a file from the explorer
If the workbench.editor.enablePreview setting is configured to be false you will never see an editor as preview no matter how the user configured it from the API.
If the workbench.editor.enablePreviewFromQuickOpen setting is configured to be false, it only impacts editors that open from quick open but nothing else.
My understanding is that we added new API for TextDocumentShowOptions to control if a document opens as preview or not. However, we are not having this option from our vscode.diff command, and as such there we now hardcode pinned: true. Wouldn't it best we do not set pinned at all for any editor we open from extensions and let the extension decide this? For example, we could add support for the vscode.diff command to define similar TextDocumentShowOptions and then the GIT extension can actually decide to open pinned or not based on user interaction (e.g. double click vs. single click).
However, we are not having this option from our vscode.diff command, and as such there we now hardcode pinned: true.
No, that isn't correct. We have added that option when adding the option for showing a text document. The change that happened is that both are now aligned wrt the default, which is 'pinned'. The diff-command used to be different here and because it is less official got aligned with the show-function. To get to old behaviour you need to pass {preview: true} when calling the diff-command.
Before these changes extensions could do the following (at least as I've observed them):
commands.executeCommand('vscode.open' ...) - would always open the document in preview (not pinned) and steal focus commands.executeCommand('vscode.diff' ...) - would always open the diff in preview (not pinned) and steal focus window.showTextDocument(...) - would always open the document not in preview (pinned) and you could control the focus
After these changes: commands.executeCommand('vscode.open' ...) - unchanged since it is deprecated commands.executeCommand('vscode.diff' ...) - opens the diff in not in preview (pinned) by default (to align with the default of showTextDocument) and takes the new TextDocumentShowOptions to control preview, focus, column, etc window.showTextDocument(...) - opens the document in not in preview (pinned) by default and takes the new TextDocumentShowOptions to control preview, focus, column, etc
So now the default behavior of both is aligned and both provide the same options.
Johannes Rieken (@jrieken)Eric Amodio (@eamodio) to me the only right way of fixing this is to not set pinned option in showTextDocument and vscode.diff unless the caller is explicitly setting this option. Otherwise there is no way to get the default behaviour we have everywhere else where the settings of the user are being looked at.
Otherwise, the only way of fixing it for the git extension is to read the user settings (specifically workbench.editor.enablePreview) and then make the decision of setting pinned or not based on that. But basically any extension that uses the vscode.diff command or the showTextDocument would have to do that if they wanted the default behaviour. I would change it and let those extensions adopt the pinned option that really want the editor to open pinned.
Reacted by Michel Makarios, Glen, Leo Antunes, scottclayton, Derek Nordgren, Ted Driggs, Benjamin Pasero, Dan MacFarlane, Bigdragon13th, Jeff Kahlina and 1 more
Activity
[-]Diff tabs opened from `Source Control` no longer in preview mode[/-][+]Diff tabs opened from the `Source Control` panel no longer in preview mode[/+]eamodio commentedon May 8, 2017
FYI, this changed here: 9f01642#diff-5d0a5d79d21dddf1284ed8ca92298d24R384
joaomoreno commentedon May 8, 2017
cc Johannes Rieken (@jrieken) already 4 users mentioned this
jrieken commentedon May 8, 2017
This was to align the behaviour of our various open-calls. João Moreno (@joaomoreno) you do have an option tho, simply set
previewto true and everything is back to normalbpasero commentedon May 9, 2017
I think the extension should not decide to set the preview flag unless it really wants to make sure that something does not open as preview (e.g. a use case I can see is to open a playground to the side of the current editor that should not go away too easily).
The workbench should deal with the preview flag, otherwise settings like
"workbench.editor.enablePreview": falseare ignored, which is bad.bdinesh commentedon May 9, 2017
Johannes Rieken (@jrieken) I have set
"workbench.editor.enablePreview": truein user settings but no luck. Is there any other setting to be set explicitly?jrieken commentedon May 10, 2017
This isn't about the setting Dinesh Bogolu (@bdinesh). Foremost extensions can express their intent when showing a text document (preview or not). Unsure how the setting plays into that, but I have a feeling that the editor service should use it and simply overrule the API choice. Correct Benjamin Pasero (@bpasero) or are there editors that must open as preview despite have that setting which blocks putting this into the service?
bpasero commentedon May 10, 2017
Johannes Rieken (@jrieken) João Moreno (@joaomoreno) today we have two settings that play a role to decide if an editor should open as preview or not:
workbench.editor.enablePreview(default:true)workbench.editor.enablePreviewFromQuickOpen(default:true)If these settings are configured by default, in most cases we open files in preview (e.g. click in explorer, open from quick open).
However, there are still some user interactions that can lead to not using preview after all independent from the setting:
If the
workbench.editor.enablePreviewsetting is configured to befalseyou will never see an editor as preview no matter how the user configured it from the API.If the
workbench.editor.enablePreviewFromQuickOpensetting is configured to befalse, it only impacts editors that open from quick open but nothing else.My understanding is that we added new API for
TextDocumentShowOptionsto control if a document opens as preview or not. However, we are not having this option from ourvscode.diffcommand, and as such there we now hardcodepinned: true. Wouldn't it best we do not setpinnedat all for any editor we open from extensions and let the extension decide this? For example, we could add support for thevscode.diffcommand to define similarTextDocumentShowOptionsand then the GIT extension can actually decide to open pinned or not based on user interaction (e.g. double click vs. single click).jrieken commentedon May 10, 2017
No, that isn't correct. We have added that option when adding the option for showing a text document. The change that happened is that both are now aligned wrt the default, which is 'pinned'. The diff-command used to be different here and because it is less official got aligned with the
show-function. To get to old behaviour you need to pass{preview: true}when calling the diff-command.eamodio commentedon May 10, 2017
Before these changes extensions could do the following (at least as I've observed them):
commands.executeCommand('vscode.open' ...)- would always open the document in preview (not pinned) and steal focuscommands.executeCommand('vscode.diff' ...)- would always open the diff in preview (not pinned) and steal focuswindow.showTextDocument(...)- would always open the document not in preview (pinned) and you could control the focusAfter these changes:
commands.executeCommand('vscode.open' ...)- unchanged since it is deprecatedcommands.executeCommand('vscode.diff' ...)- opens the diff in not in preview (pinned) by default (to align with the default ofshowTextDocument) and takes the newTextDocumentShowOptionsto control preview, focus, column, etcwindow.showTextDocument(...)- opens the document in not in preview (pinned) by default and takes the newTextDocumentShowOptionsto control preview, focus, column, etcSo now the default behavior of both is aligned and both provide the same options.
Hope that helps and makes sense.
bpasero commentedon May 12, 2017
Johannes Rieken (@jrieken) Eric Amodio (@eamodio) to me the only right way of fixing this is to not set
pinnedoption inshowTextDocumentandvscode.diffunless the caller is explicitly setting this option. Otherwise there is no way to get the default behaviour we have everywhere else where the settings of the user are being looked at.Otherwise, the only way of fixing it for the git extension is to read the user settings (specifically
workbench.editor.enablePreview) and then make the decision of settingpinnedor not based on that. But basically any extension that uses thevscode.diffcommand or theshowTextDocumentwould have to do that if they wanted the default behaviour. I would change it and let those extensions adopt thepinnedoption that really want the editor to open pinned.5 remaining items
joaomoreno commentedon May 24, 2017
Turns out I was wrong.
eamodio commentedon May 24, 2017
João Moreno (@joaomoreno) while that commit fixed it for the SCM/Git case, it didn't address Benjamin Pasero (@bpasero)'s concerns above -- so should this be re-opened or should that be moved into a separate issue?
fixes #26184
Addresses microsoft#26184 - use configuration for pinned default
Addresses #26184 - use configuration for pinned default (#27357)
fixes microsoft#26184
fixes microsoft#26184