Skip to content

Commit

Permalink
Add test for #90973
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Feb 19, 2020
1 parent 9caab0b commit 8031bfd
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/vs/editor/test/browser/controller/cursor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 8031bfd

Please sign in to comment.