Skip to content

Commit 8031bfd

Browse files
committed
Add test for microsoft#90973
1 parent 9caab0b commit 8031bfd

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

src/vs/editor/test/browser/controller/cursor.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2880,6 +2880,33 @@ suite('Editor Controller - Cursor Configuration', () => {
28802880

28812881
model.dispose();
28822882
});
2883+
2884+
test('issue #90973: Undo brings back model alternative version', () => {
2885+
let model = createTextModel(
2886+
[
2887+
''
2888+
].join('\n'),
2889+
{
2890+
insertSpaces: false,
2891+
}
2892+
);
2893+
2894+
withTestCodeEditor(null, { model: model }, (editor, cursor) => {
2895+
const beforeVersion = model.getVersionId();
2896+
const beforeAltVersion = model.getAlternativeVersionId();
2897+
cursorCommand(cursor, H.Type, { text: 'Hello' }, 'keyboard');
2898+
cursorCommand(cursor, H.Undo, {});
2899+
const afterVersion = model.getVersionId();
2900+
const afterAltVersion = model.getAlternativeVersionId();
2901+
2902+
assert.notEqual(beforeVersion, afterVersion);
2903+
assert.equal(beforeAltVersion, afterAltVersion);
2904+
});
2905+
2906+
model.dispose();
2907+
});
2908+
2909+
28832910
});
28842911

28852912
suite('Editor Controller - Indentation Rules', () => {

0 commit comments

Comments
 (0)