Skip to content

Commit 9cb3511

Browse files
devlinjunkerDevlin Junker
andauthored
Expose undo/redo and canUndo/canRedo methods on model API (microsoft#213954)
expose undo/redo and canUndo/canRedo methods on model Co-authored-by: Devlin Junker <[email protected]>
1 parent 9707a16 commit 9cb3511

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/vs/editor/common/model.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,26 +1265,22 @@ export interface ITextModel {
12651265
/**
12661266
* Undo edit operations until the previous undo/redo point.
12671267
* The inverse edit operations will be pushed on the redo stack.
1268-
* @internal
12691268
*/
12701269
undo(): void | Promise<void>;
12711270

12721271
/**
12731272
* Is there anything in the undo stack?
1274-
* @internal
12751273
*/
12761274
canUndo(): boolean;
12771275

12781276
/**
12791277
* Redo edit operations until the next undo/redo point.
12801278
* The inverse edit operations will be pushed on the undo stack.
1281-
* @internal
12821279
*/
12831280
redo(): void | Promise<void>;
12841281

12851282
/**
12861283
* Is there anything in the redo stack?
1287-
* @internal
12881284
*/
12891285
canRedo(): boolean;
12901286

src/vs/monaco.d.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,6 +2372,24 @@ declare namespace monaco.editor {
23722372
* This can have dire consequences on the undo stack! See @pushEOL for the preferred way.
23732373
*/
23742374
setEOL(eol: EndOfLineSequence): void;
2375+
/**
2376+
* Undo edit operations until the previous undo/redo point.
2377+
* The inverse edit operations will be pushed on the redo stack.
2378+
*/
2379+
undo(): void | Promise<void>;
2380+
/**
2381+
* Is there anything in the undo stack?
2382+
*/
2383+
canUndo(): boolean;
2384+
/**
2385+
* Redo edit operations until the next undo/redo point.
2386+
* The inverse edit operations will be pushed on the undo stack.
2387+
*/
2388+
redo(): void | Promise<void>;
2389+
/**
2390+
* Is there anything in the redo stack?
2391+
*/
2392+
canRedo(): boolean;
23752393
/**
23762394
* An event emitted when the contents of the model have changed.
23772395
* @event

0 commit comments

Comments
 (0)