diff --git a/src/vs/editor/test/browser/controller/cursor.test.ts b/src/vs/editor/test/browser/controller/cursor.test.ts index c4b0df1d3cba1fe34cb9c95a63c4d1994e2bbf83..6c6595c516e27132d28a28d91c20eedf3541a710 100644 --- a/src/vs/editor/test/browser/controller/cursor.test.ts +++ b/src/vs/editor/test/browser/controller/cursor.test.ts @@ -2880,6 +2880,33 @@ suite('Editor Controller - Cursor Configuration', () => { model.dispose(); }); + + test('issue #90973: Undo brings back model alternative version', () => { + let model = createTextModel( + [ + '' + ].join('\n'), + { + insertSpaces: false, + } + ); + + withTestCodeEditor(null, { model: model }, (editor, cursor) => { + const beforeVersion = model.getVersionId(); + const beforeAltVersion = model.getAlternativeVersionId(); + cursorCommand(cursor, H.Type, { text: 'Hello' }, 'keyboard'); + cursorCommand(cursor, H.Undo, {}); + const afterVersion = model.getVersionId(); + const afterAltVersion = model.getAlternativeVersionId(); + + assert.notEqual(beforeVersion, afterVersion); + assert.equal(beforeAltVersion, afterAltVersion); + }); + + model.dispose(); + }); + + }); suite('Editor Controller - Indentation Rules', () => {