mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-24 09:21:35 +01:00
Merge pull request #131199 from microsoft/dev/joyceerhl/interactive-clear-undo
Ensure user can undo `interactive.input.clear`
This commit is contained in:
@@ -50,6 +50,7 @@ import { PANEL_BORDER } from 'vs/workbench/common/theme';
|
||||
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { peekViewBorder /*, peekViewEditorBackground, peekViewResultsBackground */ } from 'vs/editor/contrib/peekView/peekView';
|
||||
import * as icons from 'vs/workbench/contrib/notebook/browser/notebookIcons';
|
||||
import { EditOperation } from 'vs/editor/common/core/editOperation';
|
||||
|
||||
|
||||
Registry.as<IEditorPaneRegistry>(EditorExtensions.EditorPane).registerEditorPane(
|
||||
@@ -452,9 +453,10 @@ registerAction2(class extends Action2 {
|
||||
if (editorControl && editorControl.notebookEditor && editorControl.codeEditor) {
|
||||
const notebookDocument = editorControl.notebookEditor.textModel;
|
||||
const textModel = editorControl.codeEditor.getModel();
|
||||
const range = editorControl.codeEditor.getModel()?.getFullModelRange();
|
||||
|
||||
if (notebookDocument && textModel) {
|
||||
textModel.setValue('');
|
||||
if (notebookDocument && textModel && range) {
|
||||
editorControl.codeEditor.executeEdits('', [EditOperation.replace(range, null)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user