fix delete last line

This commit is contained in:
Fabian Jakobs 2011-08-12 09:55:37 +02:00
commit 40d5191bb7
2 changed files with 8 additions and 4 deletions

View file

@ -99,12 +99,16 @@ module.exports = {
},
"test: delete last should also delete the new line of the previous line" : function() {
var session = new EditSession(["a", "b", "c"].join("\n"));
var session = new EditSession(["a", "b", "c", ""].join("\n"));
var editor = new Editor(new MockRenderer(), session);
editor.moveCursorTo(2, 1);
editor.removeLines();
editor.moveCursorTo(3, 0);
editor.removeLines();
assert.equal(session.toString(), "a\nb\nc");
assert.position(editor.getCursorPosition(), 2, 1);
editor.removeLines();
assert.equal(session.toString(), "a\nb");
assert.position(editor.getCursorPosition(), 1, 1);
},