|
|
|
|
@@ -1240,22 +1240,22 @@ suite('Editor Controller - Regression tests', () => {
|
|
|
|
|
CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), 'x', 'assert9');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), '\nx', 'assert10');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), '\n\t\nx', 'assert11');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), '\n\t\n\tx', 'assert12');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Redo, {});
|
|
|
|
|
CoreEditingCommands.Redo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), '\n\t\nx', 'assert13');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Redo, {});
|
|
|
|
|
CoreEditingCommands.Redo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), '\nx', 'assert14');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Redo, {});
|
|
|
|
|
CoreEditingCommands.Redo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), 'x', 'assert15');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -1263,12 +1263,12 @@ suite('Editor Controller - Regression tests', () => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('issue #23539: Setting model EOL isn\'t undoable', () => {
|
|
|
|
|
usingCursor({
|
|
|
|
|
text: [
|
|
|
|
|
'Hello',
|
|
|
|
|
'world'
|
|
|
|
|
]
|
|
|
|
|
}, (model, cursor) => {
|
|
|
|
|
withTestCodeEditor([
|
|
|
|
|
'Hello',
|
|
|
|
|
'world'
|
|
|
|
|
], {}, (editor, cursor) => {
|
|
|
|
|
const model = editor.getModel()!;
|
|
|
|
|
|
|
|
|
|
assertCursor(cursor, new Position(1, 1));
|
|
|
|
|
model.setEOL(EndOfLineSequence.LF);
|
|
|
|
|
assert.equal(model.getValue(), 'Hello\nworld');
|
|
|
|
|
@@ -1276,7 +1276,7 @@ suite('Editor Controller - Regression tests', () => {
|
|
|
|
|
model.pushEOL(EndOfLineSequence.CRLF);
|
|
|
|
|
assert.equal(model.getValue(), 'Hello\r\nworld');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo);
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(), 'Hello\nworld');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
@@ -1301,7 +1301,7 @@ suite('Editor Controller - Regression tests', () => {
|
|
|
|
|
cursorCommand(cursor, H.Type, { text: '%' }, 'keyboard');
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), '%\'%👁\'', 'assert1');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), '\'👁\'', 'assert2');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -1327,39 +1327,39 @@ suite('Editor Controller - Regression tests', () => {
|
|
|
|
|
assert.equal(model.getLineContent(1), 'Hello world');
|
|
|
|
|
assertCursor(cursor, new Position(1, 12));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'Hello world ');
|
|
|
|
|
assertCursor(cursor, new Position(1, 13));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'Hello world');
|
|
|
|
|
assertCursor(cursor, new Position(1, 12));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'Hello');
|
|
|
|
|
assertCursor(cursor, new Position(1, 6));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), '');
|
|
|
|
|
assertCursor(cursor, new Position(1, 1));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Redo, {});
|
|
|
|
|
CoreEditingCommands.Redo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'Hello');
|
|
|
|
|
assertCursor(cursor, new Position(1, 6));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Redo, {});
|
|
|
|
|
CoreEditingCommands.Redo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'Hello world');
|
|
|
|
|
assertCursor(cursor, new Position(1, 12));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Redo, {});
|
|
|
|
|
CoreEditingCommands.Redo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'Hello world ');
|
|
|
|
|
assertCursor(cursor, new Position(1, 13));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Redo, {});
|
|
|
|
|
CoreEditingCommands.Redo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'Hello world');
|
|
|
|
|
assertCursor(cursor, new Position(1, 12));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Redo, {});
|
|
|
|
|
CoreEditingCommands.Redo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'Hello world');
|
|
|
|
|
assertCursor(cursor, new Position(1, 12));
|
|
|
|
|
});
|
|
|
|
|
@@ -1735,21 +1735,21 @@ suite('Editor Controller - Regression tests', () => {
|
|
|
|
|
'\t just some text'
|
|
|
|
|
].join('\n'), '001');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo);
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(), [
|
|
|
|
|
' some lines',
|
|
|
|
|
' and more lines',
|
|
|
|
|
' just some text',
|
|
|
|
|
].join('\n'), '002');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo);
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(), [
|
|
|
|
|
'some lines',
|
|
|
|
|
'and more lines',
|
|
|
|
|
'just some text',
|
|
|
|
|
].join('\n'), '003');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo);
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(), [
|
|
|
|
|
'some lines',
|
|
|
|
|
'and more lines',
|
|
|
|
|
@@ -1935,10 +1935,8 @@ suite('Editor Controller - Regression tests', () => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('issue #9675: Undo/Redo adds a stop in between CHN Characters', () => {
|
|
|
|
|
usingCursor({
|
|
|
|
|
text: [
|
|
|
|
|
]
|
|
|
|
|
}, (model, cursor) => {
|
|
|
|
|
withTestCodeEditor([], {}, (editor, cursor) => {
|
|
|
|
|
const model = editor.getModel()!;
|
|
|
|
|
assertCursor(cursor, new Position(1, 1));
|
|
|
|
|
|
|
|
|
|
// Typing sennsei in Japanese - Hiragana
|
|
|
|
|
@@ -1957,7 +1955,7 @@ suite('Editor Controller - Regression tests', () => {
|
|
|
|
|
assert.equal(model.getLineContent(1), 'せんせい');
|
|
|
|
|
assertCursor(cursor, new Position(1, 5));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo);
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), '');
|
|
|
|
|
assertCursor(cursor, new Position(1, 1));
|
|
|
|
|
});
|
|
|
|
|
@@ -2138,7 +2136,7 @@ suite('Editor Controller - Regression tests', () => {
|
|
|
|
|
}], () => [new Selection(1, 1, 1, 1)]);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), 'Hello world!');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), 'Hello world!');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -2229,12 +2227,12 @@ suite('Editor Controller - Regression tests', () => {
|
|
|
|
|
new Selection(1, 5, 1, 5),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, null, 'keyboard');
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assertCursor(cursor, [
|
|
|
|
|
new Selection(1, 4, 1, 4),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Redo, null, 'keyboard');
|
|
|
|
|
CoreEditingCommands.Redo.runEditorCommand(null, editor, null);
|
|
|
|
|
assertCursor(cursor, [
|
|
|
|
|
new Selection(1, 5, 1, 5),
|
|
|
|
|
]);
|
|
|
|
|
@@ -2263,7 +2261,7 @@ suite('Editor Controller - Regression tests', () => {
|
|
|
|
|
new Selection(1, 1, 1, 1),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, null, 'keyboard');
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assertCursor(cursor, [
|
|
|
|
|
new Selection(1, 1, 1, 1),
|
|
|
|
|
]);
|
|
|
|
|
@@ -2378,49 +2376,49 @@ suite('Editor Controller - Cursor Configuration', () => {
|
|
|
|
|
CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 1) });
|
|
|
|
|
CoreEditingCommands.Tab.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), ' My Second Line123');
|
|
|
|
|
cursorCommand(cursor, H.Undo, null, 'keyboard');
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
|
|
|
|
|
// Tab on column 2
|
|
|
|
|
assert.equal(model.getLineContent(2), 'My Second Line123');
|
|
|
|
|
CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 2) });
|
|
|
|
|
CoreEditingCommands.Tab.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), 'M y Second Line123');
|
|
|
|
|
cursorCommand(cursor, H.Undo, null, 'keyboard');
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
|
|
|
|
|
// Tab on column 3
|
|
|
|
|
assert.equal(model.getLineContent(2), 'My Second Line123');
|
|
|
|
|
CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 3) });
|
|
|
|
|
CoreEditingCommands.Tab.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), 'My Second Line123');
|
|
|
|
|
cursorCommand(cursor, H.Undo, null, 'keyboard');
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
|
|
|
|
|
// Tab on column 4
|
|
|
|
|
assert.equal(model.getLineContent(2), 'My Second Line123');
|
|
|
|
|
CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 4) });
|
|
|
|
|
CoreEditingCommands.Tab.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), 'My Second Line123');
|
|
|
|
|
cursorCommand(cursor, H.Undo, null, 'keyboard');
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
|
|
|
|
|
// Tab on column 5
|
|
|
|
|
assert.equal(model.getLineContent(2), 'My Second Line123');
|
|
|
|
|
CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 5) });
|
|
|
|
|
CoreEditingCommands.Tab.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), 'My S econd Line123');
|
|
|
|
|
cursorCommand(cursor, H.Undo, null, 'keyboard');
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
|
|
|
|
|
// Tab on column 5
|
|
|
|
|
assert.equal(model.getLineContent(2), 'My Second Line123');
|
|
|
|
|
CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 5) });
|
|
|
|
|
CoreEditingCommands.Tab.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), 'My S econd Line123');
|
|
|
|
|
cursorCommand(cursor, H.Undo, null, 'keyboard');
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
|
|
|
|
|
// Tab on column 13
|
|
|
|
|
assert.equal(model.getLineContent(2), 'My Second Line123');
|
|
|
|
|
CoreNavigationCommands.MoveTo.runCoreEditorCommand(cursor, { position: new Position(2, 13) });
|
|
|
|
|
CoreEditingCommands.Tab.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), 'My Second Li ne123');
|
|
|
|
|
cursorCommand(cursor, H.Undo, null, 'keyboard');
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
|
|
|
|
|
// Tab on column 14
|
|
|
|
|
assert.equal(model.getLineContent(2), 'My Second Line123');
|
|
|
|
|
@@ -2774,7 +2772,7 @@ suite('Editor Controller - Cursor Configuration', () => {
|
|
|
|
|
assert.equal(model.getLineContent(2), 'a ');
|
|
|
|
|
|
|
|
|
|
// Undo DeleteLeft - get us back to original indentation
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), ' a ');
|
|
|
|
|
|
|
|
|
|
// Nothing is broken when cursor is in (1,1)
|
|
|
|
|
@@ -2859,22 +2857,22 @@ suite('Editor Controller - Cursor Configuration', () => {
|
|
|
|
|
CoreEditingCommands.DeleteLeft.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), 'x', 'assert10');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), '\nx', 'assert11');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), '\n\ty\nx', 'assert12');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), '\n\ty\n\tx', 'assert13');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Redo, {});
|
|
|
|
|
CoreEditingCommands.Redo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), '\n\ty\nx', 'assert14');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Redo, {});
|
|
|
|
|
CoreEditingCommands.Redo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), '\nx', 'assert15');
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Redo, {});
|
|
|
|
|
CoreEditingCommands.Redo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getValue(EndOfLinePreference.LF), 'x', 'assert16');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -2895,7 +2893,7 @@ suite('Editor Controller - Cursor Configuration', () => {
|
|
|
|
|
const beforeVersion = model.getVersionId();
|
|
|
|
|
const beforeAltVersion = model.getAlternativeVersionId();
|
|
|
|
|
cursorCommand(cursor, H.Type, { text: 'Hello' }, 'keyboard');
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
const afterVersion = model.getVersionId();
|
|
|
|
|
const afterAltVersion = model.getAlternativeVersionId();
|
|
|
|
|
|
|
|
|
|
@@ -4263,7 +4261,7 @@ suite('autoClosingPairs', () => {
|
|
|
|
|
moveTo(cursor, lineNumber, column);
|
|
|
|
|
cursorCommand(cursor, H.Type, { text: chr }, 'keyboard');
|
|
|
|
|
assert.deepEqual(model.getLineContent(lineNumber), expected, message);
|
|
|
|
|
cursorCommand(cursor, H.Undo);
|
|
|
|
|
model.undo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
test('open parens: default', () => {
|
|
|
|
|
@@ -5347,11 +5345,11 @@ suite('Undo stops', () => {
|
|
|
|
|
assert.equal(model.getLineContent(1), 'A fir line');
|
|
|
|
|
assertCursor(cursor, new Selection(1, 6, 1, 6));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'A first line');
|
|
|
|
|
assertCursor(cursor, new Selection(1, 8, 1, 8));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'A line');
|
|
|
|
|
assertCursor(cursor, new Selection(1, 3, 1, 3));
|
|
|
|
|
});
|
|
|
|
|
@@ -5376,11 +5374,11 @@ suite('Undo stops', () => {
|
|
|
|
|
assert.equal(model.getLineContent(1), 'A firstine');
|
|
|
|
|
assertCursor(cursor, new Selection(1, 8, 1, 8));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'A first line');
|
|
|
|
|
assertCursor(cursor, new Selection(1, 8, 1, 8));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'A line');
|
|
|
|
|
assertCursor(cursor, new Selection(1, 3, 1, 3));
|
|
|
|
|
});
|
|
|
|
|
@@ -5410,11 +5408,11 @@ suite('Undo stops', () => {
|
|
|
|
|
assert.equal(model.getLineContent(2), 'Second line');
|
|
|
|
|
assertCursor(cursor, new Selection(2, 7, 2, 7));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), ' line');
|
|
|
|
|
assertCursor(cursor, new Selection(2, 1, 2, 1));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), 'Another line');
|
|
|
|
|
assertCursor(cursor, new Selection(2, 8, 2, 8));
|
|
|
|
|
});
|
|
|
|
|
@@ -5448,11 +5446,11 @@ suite('Undo stops', () => {
|
|
|
|
|
assert.equal(model.getLineContent(2), '');
|
|
|
|
|
assertCursor(cursor, new Selection(2, 1, 2, 1));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), ' line');
|
|
|
|
|
assertCursor(cursor, new Selection(2, 1, 2, 1));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), 'Another line');
|
|
|
|
|
assertCursor(cursor, new Selection(2, 8, 2, 8));
|
|
|
|
|
});
|
|
|
|
|
@@ -5479,11 +5477,11 @@ suite('Undo stops', () => {
|
|
|
|
|
assert.equal(model.getLineContent(2), 'Another text');
|
|
|
|
|
assertCursor(cursor, new Selection(2, 13, 2, 13));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), 'Another ');
|
|
|
|
|
assertCursor(cursor, new Selection(2, 9, 2, 9));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), 'Another line');
|
|
|
|
|
assertCursor(cursor, new Selection(2, 9, 2, 9));
|
|
|
|
|
});
|
|
|
|
|
@@ -5515,11 +5513,11 @@ suite('Undo stops', () => {
|
|
|
|
|
assert.equal(model.getLineContent(2), 'An');
|
|
|
|
|
assertCursor(cursor, new Selection(2, 3, 2, 3));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), 'Another ');
|
|
|
|
|
assertCursor(cursor, new Selection(2, 9, 2, 9));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(2), 'Another line');
|
|
|
|
|
assertCursor(cursor, new Selection(2, 9, 2, 9));
|
|
|
|
|
});
|
|
|
|
|
@@ -5539,15 +5537,15 @@ suite('Undo stops', () => {
|
|
|
|
|
assert.equal(model.getLineContent(1), 'A first and interesting line');
|
|
|
|
|
assertCursor(cursor, new Selection(1, 24, 1, 24));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'A first and line');
|
|
|
|
|
assertCursor(cursor, new Selection(1, 12, 1, 12));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'A first line');
|
|
|
|
|
assertCursor(cursor, new Selection(1, 8, 1, 8));
|
|
|
|
|
|
|
|
|
|
cursorCommand(cursor, H.Undo, {});
|
|
|
|
|
CoreEditingCommands.Undo.runEditorCommand(null, editor, null);
|
|
|
|
|
assert.equal(model.getLineContent(1), 'A line');
|
|
|
|
|
assertCursor(cursor, new Selection(1, 3, 1, 3));
|
|
|
|
|
});
|
|
|
|
|
|