提交 5a8042db 编写于 作者: B Beyang Liu 提交者: Benjamin Pasero

remove kludge that adds history item when new input is set on an editor (#35682)

上级 ad42cac7
......@@ -24,7 +24,6 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
import { IHistoryService } from 'vs/workbench/services/history/common/history';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { CancelAction } from 'vs/platform/message/common/message';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
......@@ -47,7 +46,6 @@ export class TextFileEditor extends BaseTextEditor {
@IInstantiationService instantiationService: IInstantiationService,
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IStorageService storageService: IStorageService,
@IHistoryService private historyService: IHistoryService,
@ITextResourceConfigurationService configurationService: ITextResourceConfigurationService,
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@IThemeService themeService: IThemeService,
......@@ -87,16 +85,6 @@ export class TextFileEditor extends BaseTextEditor {
public setInput(input: FileEditorInput, options?: EditorOptions): TPromise<void> {
// We have a current input in this editor and are about to either open a new editor or jump to a different
// selection inside the editor. Thus we store the current selection into the navigation history so that
// a user can navigate back to the exact position he left off.
if (this.input) {
const selection = this.getControl().getSelection();
if (selection) {
this.historyService.add(this.input, { startLineNumber: selection.startLineNumber, startColumn: selection.startColumn });
}
}
// Return early for same input unless we force to open
const forceOpen = options && options.forceOpen;
if (!forceOpen && input.matches(this.input)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册