Merge branch 'master' of github.com:ajaxorg/ace
This commit is contained in:
commit
7263b07932
9 changed files with 38 additions and 28 deletions
|
|
@ -117,6 +117,7 @@ After the checkout Ace works out of the box. No build step is required. Open 'ed
|
|||
Or using Node.JS
|
||||
|
||||
```bash
|
||||
npm install mime
|
||||
./static.js
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -645,9 +645,9 @@ bindDropdown("split", function(value) {
|
|||
} else {
|
||||
var newEditor = (sp.getSplits() == 1);
|
||||
if (value == "below") {
|
||||
sp.setOriantation(sp.BELOW);
|
||||
sp.setOrientation(sp.BELOW);
|
||||
} else {
|
||||
sp.setOriantation(sp.BESIDE);
|
||||
sp.setOrientation(sp.BESIDE);
|
||||
}
|
||||
sp.setSplits(2);
|
||||
|
||||
|
|
@ -20973,7 +20973,7 @@ var Split = function(container, theme, splits) {
|
|||
this.$splits = 0;
|
||||
this.$editorCSS = "";
|
||||
this.$editors = [];
|
||||
this.$oriantation = this.BESIDE;
|
||||
this.$orientation = this.BESIDE;
|
||||
|
||||
this.setSplits(splits || 1);
|
||||
this.$cEditor = this.$editors[0];
|
||||
|
|
@ -21130,15 +21130,15 @@ var Split = function(container, theme, splits) {
|
|||
return session;
|
||||
};
|
||||
|
||||
this.getOriantation = function() {
|
||||
return this.$oriantation;
|
||||
this.getOrientation = function() {
|
||||
return this.$orientation;
|
||||
};
|
||||
|
||||
this.setOriantation = function(oriantation) {
|
||||
if (this.$oriantation == oriantation) {
|
||||
this.setOrientation = function(orientation) {
|
||||
if (this.$orientation == orientation) {
|
||||
return;
|
||||
}
|
||||
this.$oriantation = oriantation;
|
||||
this.$orientation = orientation;
|
||||
this.resize();
|
||||
};
|
||||
|
||||
|
|
@ -21147,7 +21147,7 @@ var Split = function(container, theme, splits) {
|
|||
var height = this.$container.clientHeight;
|
||||
var editor;
|
||||
|
||||
if (this.$oriantation == this.BESIDE) {
|
||||
if (this.$orientation == this.BESIDE) {
|
||||
var editorWidth = width / this.$splits;
|
||||
for (var i = 0; i < this.$splits; i++) {
|
||||
editor = this.$editors[i];
|
||||
|
|
|
|||
|
|
@ -11975,6 +11975,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
|
||||
// full
|
||||
if (changes & this.CHANGE_FULL) {
|
||||
this.$textLayer.checkForSizeChanges();
|
||||
this.$textLayer.update(this.layerConfig);
|
||||
if (this.showGutter)
|
||||
this.$gutterLayer.update(this.layerConfig);
|
||||
|
|
@ -12950,6 +12951,11 @@ var Text = function(parentEl) {
|
|||
|
||||
}
|
||||
|
||||
// Size and width can be null if the editor is not visible or
|
||||
// detached from the document
|
||||
if (!this.element.offsetWidth)
|
||||
return null;
|
||||
|
||||
var style = this.$measureNode.style;
|
||||
var computedStyle = dom.computedStyle(this.element);
|
||||
for (var prop in this.$fontStyles)
|
||||
|
|
@ -12964,7 +12970,6 @@ var Text = function(parentEl) {
|
|||
// detached from the document
|
||||
if (size.width == 0 && size.height == 0)
|
||||
return null;
|
||||
|
||||
return size;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -455,9 +455,9 @@ bindDropdown("split", function(value) {
|
|||
} else {
|
||||
var newEditor = (sp.getSplits() == 1);
|
||||
if (value == "below") {
|
||||
sp.setOriantation(sp.BELOW);
|
||||
sp.setOrientation(sp.BELOW);
|
||||
} else {
|
||||
sp.setOriantation(sp.BESIDE);
|
||||
sp.setOrientation(sp.BESIDE);
|
||||
}
|
||||
sp.setSplits(2);
|
||||
|
||||
|
|
|
|||
|
|
@ -132,6 +132,11 @@ var Text = function(parentEl) {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
// Size and width can be null if the editor is not visible or
|
||||
// detached from the document
|
||||
if (!this.element.offsetWidth)
|
||||
return null;
|
||||
|
||||
var style = this.$measureNode.style;
|
||||
var computedStyle = dom.computedStyle(this.element);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ var ColdfusionHighlightRules = function() {
|
|||
}, {
|
||||
token : "meta.tag",
|
||||
regex : "<(?=\s*style)",
|
||||
next : "css"
|
||||
next : "style"
|
||||
}, {
|
||||
token : "meta.tag", // opening tag
|
||||
regex : "<\\/?",
|
||||
|
|
@ -109,7 +109,7 @@ var ColdfusionHighlightRules = function() {
|
|||
};
|
||||
|
||||
xml_util.tag(this.$rules, "tag", "start");
|
||||
xml_util.tag(this.$rules, "css", "css-start");
|
||||
xml_util.tag(this.$rules, "style", "css-start");
|
||||
xml_util.tag(this.$rules, "script", "js-start");
|
||||
|
||||
this.embedRules(JavaScriptHighlightRules, "js-", [{
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ var HtmlHighlightRules = function() {
|
|||
}, {
|
||||
token : "meta.tag",
|
||||
regex : "<(?=\s*style\\b)",
|
||||
next : "css"
|
||||
next : "style"
|
||||
}, {
|
||||
token : "meta.tag", // opening tag
|
||||
regex : "<\\/?",
|
||||
|
|
@ -108,7 +108,7 @@ var HtmlHighlightRules = function() {
|
|||
};
|
||||
|
||||
xmlUtil.tag(this.$rules, "tag", "start");
|
||||
xmlUtil.tag(this.$rules, "css", "css-start");
|
||||
xmlUtil.tag(this.$rules, "style", "css-start");
|
||||
xmlUtil.tag(this.$rules, "script", "js-start");
|
||||
|
||||
this.embedRules(JavaScriptHighlightRules, "js-", [{
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ function string(state) {
|
|||
token : "string", // multi line string start
|
||||
merge : true,
|
||||
regex : '["].*',
|
||||
next : state + "-qqstring"
|
||||
next : state + "_qqstring"
|
||||
}, {
|
||||
token : "string",
|
||||
regex : "'.*?'"
|
||||
|
|
@ -64,7 +64,7 @@ function string(state) {
|
|||
token : "string", // multi line string start
|
||||
merge : true,
|
||||
regex : "['].*",
|
||||
next : state + "-qstring"
|
||||
next : state + "_qstring"
|
||||
}];
|
||||
}
|
||||
|
||||
|
|
@ -113,17 +113,17 @@ exports.tag = function(states, name, nextState) {
|
|||
},
|
||||
merge : true,
|
||||
regex : "[-_a-zA-Z0-9:!]+",
|
||||
next : name + "embed-attribute-list"
|
||||
next : name + "_embed_attribute_list"
|
||||
}, {
|
||||
token: "empty",
|
||||
regex: "",
|
||||
next : name + "embed-attribute-list"
|
||||
next : name + "_embed_attribute_list"
|
||||
}];
|
||||
|
||||
states[name + "-qstring"] = multiLineString("'", name + "embed-attribute-list");
|
||||
states[name + "-qqstring"] = multiLineString("\"", name + "embed-attribute-list");
|
||||
states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
|
||||
states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
|
||||
|
||||
states[name + "embed-attribute-list"] = [{
|
||||
states[name + "_embed_attribute_list"] = [{
|
||||
token : "meta.tag",
|
||||
merge : true,
|
||||
regex : "\/?>",
|
||||
|
|
|
|||
|
|
@ -423,6 +423,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
|
||||
// full
|
||||
if (changes & this.CHANGE_FULL) {
|
||||
this.$textLayer.checkForSizeChanges();
|
||||
this.$textLayer.update(this.layerConfig);
|
||||
if (this.showGutter)
|
||||
this.$gutterLayer.update(this.layerConfig);
|
||||
|
|
@ -666,7 +667,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
};
|
||||
|
||||
this.getScrollLeft = function() {
|
||||
return this.session.getScrollTop();
|
||||
return this.session.getScrollLeft();
|
||||
};
|
||||
|
||||
this.getScrollTopRow = function() {
|
||||
|
|
@ -726,12 +727,10 @@ var VirtualRenderer = function(container, theme) {
|
|||
var canvasPos = this.scroller.getBoundingClientRect();
|
||||
|
||||
var col = Math.round(
|
||||
(pageX + this.scrollLeft - canvasPos.left - this.$padding - dom.getPageScrollLeft())
|
||||
/ this.characterWidth
|
||||
(pageX + this.scrollLeft - canvasPos.left - this.$padding - dom.getPageScrollLeft()) / this.characterWidth
|
||||
);
|
||||
var row = Math.floor(
|
||||
(pageY + this.scrollTop - canvasPos.top - dom.getPageScrollTop())
|
||||
/ this.lineHeight
|
||||
(pageY + this.scrollTop - canvasPos.top - dom.getPageScrollTop()) / this.lineHeight
|
||||
);
|
||||
|
||||
return this.session.screenToDocumentPosition(row, Math.max(col, 0));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue