Merge pull request #475 from nightwing/pullreq
double click with highlightAll on crashes browser
This commit is contained in:
commit
cf4773176c
6 changed files with 28 additions and 31 deletions
|
|
@ -420,7 +420,7 @@ module.exports = {
|
|||
|
||||
var editor = new Editor(new MockRenderer(), session);
|
||||
editor.moveCursorTo(1, 1);
|
||||
editor.removeLeft();
|
||||
editor.remove("left");
|
||||
assert.equal(session.toString(), "123\n56");
|
||||
},
|
||||
|
||||
|
|
@ -429,7 +429,7 @@ module.exports = {
|
|||
|
||||
var editor = new Editor(new MockRenderer(), session);
|
||||
editor.moveCursorTo(1, 0);
|
||||
editor.removeLeft();
|
||||
editor.remove("left");
|
||||
assert.equal(session.toString(), "123456");
|
||||
},
|
||||
|
||||
|
|
@ -440,7 +440,7 @@ module.exports = {
|
|||
|
||||
var editor = new Editor(new MockRenderer(), session);
|
||||
editor.moveCursorTo(1, 8);
|
||||
editor.removeLeft();
|
||||
editor.remove("left");
|
||||
assert.equal(session.toString(), "123\n 456");
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ module.exports = {
|
|||
assert.equal(
|
||||
stringBuilder.join(""),
|
||||
"<span class='ace_cjk ace_invisible' style='width:20px'>" + this.textLayer.SPACE_CHAR + "</span>"
|
||||
+ "<span class='ace_invisible'>¶</span>"
|
||||
+ "<span class='ace_invisible'>\xB6</span>"
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -78,9 +78,9 @@ module.exports = {
|
|||
var tokens = this.tokenizer.getLineTokens("{()}", "start").tokens;
|
||||
|
||||
assert.equal(3, tokens.length);
|
||||
assert.equal("lparen", tokens[0].type);
|
||||
assert.equal("paren.lparen", tokens[0].type);
|
||||
assert.equal("text", tokens[1].type);
|
||||
assert.equal("rparen", tokens[2].type);
|
||||
assert.equal("paren.rparen", tokens[2].type);
|
||||
},
|
||||
|
||||
"test for last rule in ruleset to catch capturing group bugs" : function() {
|
||||
|
|
|
|||
|
|
@ -95,20 +95,20 @@ module.exports = {
|
|||
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
|
||||
|
||||
assert.equal(7, tokens.length);
|
||||
assert.equal("lparen", tokens[0].type);
|
||||
assert.equal("lparen", tokens[1].type);
|
||||
assert.equal("lparen", tokens[2].type);
|
||||
assert.equal("paren.lparen", tokens[0].type);
|
||||
assert.equal("paren.lparen", tokens[1].type);
|
||||
assert.equal("paren.lparen", tokens[2].type);
|
||||
assert.equal("text", tokens[3].type);
|
||||
assert.equal("rparen", tokens[4].type);
|
||||
assert.equal("rparen", tokens[5].type);
|
||||
assert.equal("rparen", tokens[6].type);
|
||||
assert.equal("paren.rparen", tokens[4].type);
|
||||
assert.equal("paren.rparen", tokens[5].type);
|
||||
assert.equal("paren.rparen", tokens[6].type);
|
||||
},
|
||||
|
||||
"test for last rule in ruleset to catch capturing group bugs" : function() {
|
||||
var tokens = this.tokenizer.getLineTokens("}", "start").tokens;
|
||||
|
||||
assert.equal(1, tokens.length);
|
||||
assert.equal("rparen", tokens[0].type);
|
||||
assert.equal("paren.rparen", tokens[0].type);
|
||||
},
|
||||
|
||||
"test tokenize arithmetic expression which looks like a regexp": function() {
|
||||
|
|
@ -160,7 +160,7 @@ module.exports = {
|
|||
"test // is not a regexp": function() {
|
||||
var tokens = this.tokenizer.getLineTokens("{ // 123", "start").tokens;
|
||||
assert.equal(3, tokens.length);
|
||||
assert.equal("lparen", tokens[0].type);
|
||||
assert.equal("paren.lparen", tokens[0].type);
|
||||
assert.equal("text", tokens[1].type);
|
||||
assert.equal("comment", tokens[2].type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,29 +89,27 @@ Search.SELECTION = 2;
|
|||
};
|
||||
|
||||
this.findAll = function(session) {
|
||||
if (!this.$options.needle)
|
||||
var options = this.$options;
|
||||
if (!options.needle)
|
||||
return [];
|
||||
|
||||
if (this.$options.backwards) {
|
||||
if (options.backwards) {
|
||||
var iterator = this.$backwardMatchIterator(session);
|
||||
} else {
|
||||
iterator = this.$forwardMatchIterator(session);
|
||||
}
|
||||
|
||||
var ignoreCursorColumn = this.$options.wrap && this.$options.scope == Search.ALL;
|
||||
var start = session.getSelection().getCursor();
|
||||
if (ignoreCursorColumn) {
|
||||
session.getSelection().moveCursorTo(0, 0);
|
||||
}
|
||||
var ignoreCursor = !options.start && options.wrap && options.scope == Search.ALL;
|
||||
if (ignoreCursor)
|
||||
options.start = {row: 0, column: 0};
|
||||
|
||||
var ranges = [];
|
||||
iterator.forEach(function(range) {
|
||||
ranges.push(range);
|
||||
});
|
||||
|
||||
if (ignoreCursorColumn) {
|
||||
session.getSelection().moveCursorTo(start.row, start.column)
|
||||
}
|
||||
if (ignoreCursor)
|
||||
options.start = null;
|
||||
|
||||
return ranges;
|
||||
};
|
||||
|
|
@ -223,8 +221,8 @@ Search.SELECTION = 2;
|
|||
this.$forwardLineIterator = function(session) {
|
||||
var searchSelection = this.$options.scope == Search.SELECTION;
|
||||
|
||||
var range = session.getSelection().getRange();
|
||||
var start = session.getSelection().getCursor();
|
||||
var range = this.$options.range || session.getSelection().getRange();
|
||||
var start = this.$options.start || session.getSelection().getCursor();
|
||||
|
||||
var firstRow = searchSelection ? range.start.row : 0;
|
||||
var firstColumn = searchSelection ? range.start.column : 0;
|
||||
|
|
@ -285,8 +283,8 @@ Search.SELECTION = 2;
|
|||
this.$backwardLineIterator = function(session) {
|
||||
var searchSelection = this.$options.scope == Search.SELECTION;
|
||||
|
||||
var range = session.getSelection().getRange();
|
||||
var start = searchSelection ? range.end : range.start;
|
||||
var range = this.$options.range || session.getSelection().getRange();
|
||||
var start = this.$options.start || session.getSelection().getCursor();
|
||||
|
||||
var firstRow = searchSelection ? range.start.row : 0;
|
||||
var firstColumn = searchSelection ? range.start.column : 0;
|
||||
|
|
|
|||
|
|
@ -27,8 +27,7 @@
|
|||
var require = {
|
||||
paths: {
|
||||
ace: "../",
|
||||
cockpit: "../../../../support/cockpit/lib/cockpit",
|
||||
pilot: "../../../../support/pilot/lib/pilot"
|
||||
pilot: "../../../support/pilot/lib/pilot"
|
||||
},
|
||||
packages : [{
|
||||
name: "asyncjs",
|
||||
|
|
@ -41,7 +40,7 @@
|
|||
}]
|
||||
};
|
||||
</script>
|
||||
<script src="../../../demo/require.js" data-main="all_browser" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="../../../demo/kitchen-sink/require.js" data-main="all_browser" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue