change "delete last line" behavior to match vim
This commit is contained in:
parent
85ce847fab
commit
a39ab0d607
2 changed files with 11 additions and 8 deletions
|
|
@ -67,13 +67,13 @@ module.exports = {
|
|||
|
||||
editor.removeLines();
|
||||
|
||||
assert.equal(session.toString(), "a\n");
|
||||
assert.position(editor.getCursorPosition(), 1, 0);
|
||||
assert.equal(session.toString(), "a");
|
||||
assert.position(editor.getCursorPosition(), 0, 1);
|
||||
|
||||
editor.removeLines();
|
||||
|
||||
assert.equal(session.toString(), "a\n");
|
||||
assert.position(editor.getCursorPosition(), 1, 0);
|
||||
assert.equal(session.toString(), "");
|
||||
assert.position(editor.getCursorPosition(), 0, 0);
|
||||
},
|
||||
|
||||
"test: delete multiple selected lines" : function() {
|
||||
|
|
@ -98,15 +98,15 @@ module.exports = {
|
|||
assert.position(editor.getCursorPosition(), 0, 0);
|
||||
},
|
||||
|
||||
"test: delete last" : function() {
|
||||
"test: delete last should also delete the new line of the previous line" : function() {
|
||||
var session = new EditSession(["a", "b", "c"].join("\n"));
|
||||
var editor = new Editor(new MockRenderer(), session);
|
||||
|
||||
editor.moveCursorTo(2, 1);
|
||||
editor.removeLines();
|
||||
|
||||
assert.equal(session.toString(), "a\nb\n");
|
||||
assert.position(editor.getCursorPosition(), 2, 0);
|
||||
assert.equal(session.toString(), "a\nb");
|
||||
assert.position(editor.getCursorPosition(), 1, 1);
|
||||
},
|
||||
|
||||
"test: indent block" : function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue