diff --git a/src/vs/editor/contrib/format/common/formatActions.ts b/src/vs/editor/contrib/format/common/formatActions.ts index 92630b56b33..0f6d0897893 100644 --- a/src/vs/editor/contrib/format/common/formatActions.ts +++ b/src/vs/editor/contrib/format/common/formatActions.ts @@ -198,17 +198,8 @@ export class FormatAction extends EditorAction { } public apply(editor: editorCommon.ICommonCodeEditor, editorSelection: Selection, value: editorCommon.ISingleEditOperation[]): void { - var state: editorCommon.IEditorViewState = null; - - if (editorSelection.isEmpty()) { - state = editor.saveViewState(); - } - var command = new EditOperationsCommand(value, editorSelection); + const command = new EditOperationsCommand(value, editorSelection); editor.executeCommand(this.id, command); - - if (state) { - editor.restoreViewState(state); - } } }