new rule on behavior when doing keyboard navigation + tests
This commit is contained in:
parent
125d9bfbfd
commit
b9955714f1
3 changed files with 59 additions and 11 deletions
|
|
@ -442,6 +442,42 @@ module.exports = {
|
|||
selection.moveCursorUp();
|
||||
selection.moveCursorDown();
|
||||
|
||||
assert.position(selection.getCursor(), 1, 4);
|
||||
},
|
||||
|
||||
"test (keyboard navigation) when curLine is EOL and targetLine is all whitespace new column should be targetLine's EOL": function() {
|
||||
var session = new EditSession("function (a) {\n\
|
||||
\n\
|
||||
}");
|
||||
var selection = session.getSelection();
|
||||
|
||||
selection.moveCursorTo(2, 1);
|
||||
selection.moveCursorUp();
|
||||
|
||||
assert.position(selection.getCursor(), 1, 4);
|
||||
},
|
||||
|
||||
"test (keyboard navigation) when curLine is not EOL and targetLine is all whitespace new column should be current column": function() {
|
||||
var session = new EditSession("function (a) {\n\
|
||||
\n\
|
||||
}");
|
||||
var selection = session.getSelection();
|
||||
|
||||
selection.moveCursorTo(2, 0);
|
||||
selection.moveCursorUp();
|
||||
|
||||
assert.position(selection.getCursor(), 1, 0);
|
||||
},
|
||||
|
||||
"test (keyboard navigation) when curLine is EOL and targetLine is shorter dan current column, new column should be targetLine's EOL": function() {
|
||||
var session = new EditSession("function (a) {\n\
|
||||
\n\
|
||||
}");
|
||||
var selection = session.getSelection();
|
||||
|
||||
selection.moveCursorTo(0, 14);
|
||||
selection.moveCursorDown();
|
||||
|
||||
assert.position(selection.getCursor(), 1, 4);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue