mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
adopt ITextEditorOptions
This commit is contained in:
@@ -10,12 +10,12 @@ import platform = require('vs/base/common/platform');
|
||||
import nls = require('vs/nls');
|
||||
import {EventType} from 'vs/base/common/events';
|
||||
import {IEditor as IBaseEditor} from 'vs/platform/editor/common/editor';
|
||||
import {TextEditorOptions, EditorInput, IGroupEvent, IEditorRegistry, Extensions} from 'vs/workbench/common/editor';
|
||||
import {EditorInput, IGroupEvent, IEditorRegistry, Extensions} from 'vs/workbench/common/editor';
|
||||
import {BaseTextEditor} from 'vs/workbench/browser/parts/editor/textEditor';
|
||||
import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
|
||||
import {IHistoryService} from 'vs/workbench/services/history/common/history';
|
||||
import {Selection} from 'vs/editor/common/core/selection';
|
||||
import {Position, IEditorInput} from 'vs/platform/editor/common/editor';
|
||||
import {Position, IEditorInput, ITextEditorOptions} from 'vs/platform/editor/common/editor';
|
||||
import {IEventService} from 'vs/platform/event/common/event';
|
||||
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
@@ -207,7 +207,7 @@ export abstract class BaseHistoryService {
|
||||
|
||||
interface IStackEntry {
|
||||
input: IEditorInput;
|
||||
options?: TextEditorOptions;
|
||||
options?: ITextEditorOptions;
|
||||
}
|
||||
|
||||
export class HistoryService extends BaseHistoryService implements IHistoryService {
|
||||
@@ -441,10 +441,12 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic
|
||||
if (!this.currentFileEditorState || this.currentFileEditorState.justifiesNewPushState(stateCandidate)) {
|
||||
this.currentFileEditorState = stateCandidate;
|
||||
|
||||
let options: TextEditorOptions;
|
||||
let options: ITextEditorOptions;
|
||||
if (storeSelection) {
|
||||
options = new TextEditorOptions();
|
||||
options.selection(editor.getSelection().startLineNumber, editor.getSelection().startColumn);
|
||||
const selection = editor.getSelection();
|
||||
options = {
|
||||
selection: { startLineNumber: selection.startLineNumber, startColumn: selection.startColumn }
|
||||
};
|
||||
}
|
||||
|
||||
this.addToStack(editor.input, options);
|
||||
@@ -460,7 +462,7 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic
|
||||
this.addToStack(editor.input);
|
||||
}
|
||||
|
||||
private addToStack(input: IEditorInput, options?: TextEditorOptions): void {
|
||||
private addToStack(input: IEditorInput, options?: ITextEditorOptions): void {
|
||||
|
||||
// Overwrite an entry in the stack if we have a matching input that comes
|
||||
// with editor options to indicate that this entry is more specific.
|
||||
|
||||
Reference in New Issue
Block a user