make move word right/left consistent with OSX behavior (XCode)
fix #542
This commit is contained in:
parent
96b6abb615
commit
9cb05c2e56
2 changed files with 48 additions and 44 deletions
|
|
@ -120,6 +120,9 @@ module.exports = {
|
|||
// wrap line
|
||||
selection.moveCursorWordRight();
|
||||
assert.position(selection.getCursor(), 2, 4);
|
||||
|
||||
selection.moveCursorWordRight();
|
||||
assert.position(selection.getCursor(), 2, 4);
|
||||
},
|
||||
|
||||
"test: select word right if cursor in word" : function() {
|
||||
|
|
@ -145,36 +148,24 @@ module.exports = {
|
|||
selection.moveCursorLineEnd();
|
||||
assert.position(selection.getCursor(), 1, 23);
|
||||
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 1, 22);
|
||||
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 1, 20);
|
||||
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 1, 18);
|
||||
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 1, 15);
|
||||
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 1, 13);
|
||||
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 1, 6);
|
||||
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 1, 5);
|
||||
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 1, 1);
|
||||
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 1, 0);
|
||||
|
||||
// wrap line
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 0, 2);
|
||||
assert.position(selection.getCursor(), 0, 0);
|
||||
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 0, 0);
|
||||
},
|
||||
|
||||
"test: moveCursor word left" : function() {
|
||||
|
|
@ -186,7 +177,7 @@ module.exports = {
|
|||
assert.position(selection.getCursor(), 0, 5);
|
||||
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 0, 4);
|
||||
assert.position(selection.getCursor(), 0, 1);
|
||||
},
|
||||
|
||||
"test: select word left if cursor in word" : function() {
|
||||
|
|
@ -310,15 +301,11 @@ module.exports = {
|
|||
assert.notOk(called);
|
||||
},
|
||||
|
||||
"test: moveWordLeft should move past || and [": function() {
|
||||
"test: moveWordright should move past || and [": function() {
|
||||
var session = new EditSession("||foo[");
|
||||
var selection = session.getSelection();
|
||||
|
||||
// Move behind ||
|
||||
selection.moveCursorWordRight();
|
||||
assert.position(selection.getCursor(), 0, 2);
|
||||
|
||||
// Move beind foo
|
||||
// Move behind ||foo
|
||||
selection.moveCursorWordRight();
|
||||
assert.position(selection.getCursor(), 0, 5);
|
||||
|
||||
|
|
@ -327,17 +314,13 @@ module.exports = {
|
|||
assert.position(selection.getCursor(), 0, 6);
|
||||
},
|
||||
|
||||
"test: moveWordRight should move past || and [": function() {
|
||||
"test: moveWordLeft should move past || and [": function() {
|
||||
var session = new EditSession("||foo[");
|
||||
var selection = session.getSelection();
|
||||
|
||||
selection.moveCursorTo(0, 6);
|
||||
|
||||
// Move behind [
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 0, 5);
|
||||
|
||||
// Move beind foo
|
||||
// Move behind [foo
|
||||
selection.moveCursorWordLeft();
|
||||
assert.position(selection.getCursor(), 0, 2);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue