[occur] fixing recursive occurs
This commit is contained in:
parent
96bca7ed95
commit
d75845f3aa
2 changed files with 27 additions and 3 deletions
|
|
@ -120,6 +120,29 @@ module.exports = {
|
|||
editor.execCommand('occuraccept');
|
||||
|
||||
assert.position(editor.getCursorPosition(), 3, 1, 'occur -> original pos');
|
||||
},
|
||||
|
||||
"test: recursive occur" : function() {
|
||||
// setup
|
||||
var text = 'x\nabc1\nx\nabc2\n';
|
||||
editor.session.insert({row: 0, column: 0}, text);
|
||||
editor.commands.addCommands(occurCommands);
|
||||
|
||||
// orig -> occur1
|
||||
editor.execCommand('occur', {needle: 'abc'});
|
||||
assert.equal(editor.getValue(), 'abc1\nabc2', "orig -> occur1");
|
||||
|
||||
// occur1 -> occur2
|
||||
editor.execCommand('occur', {needle: '2'});
|
||||
assert.equal(editor.getValue(), 'abc2', "occur1 -> occur2");
|
||||
|
||||
// occur2 -> occur1
|
||||
editor.execCommand('occurexit');
|
||||
assert.equal(editor.getValue(), 'abc1\nabc2', "occur2 -> occur1");
|
||||
|
||||
// occur1 -> orig
|
||||
editor.execCommand('occurexit');
|
||||
assert.equal(editor.getValue(), text, "occur1 -> orig");
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue