* Merged with master

* Built ace

Merge branch 'master' of github.com:ajaxorg/ace into feature/animscroll

Conflicts:
	build/kitchen-sink.html
	build/src/ace-noconflict.js
	build/src/ace.js
	build/src/mode-c_cpp-noconflict.js
	build/src/mode-c_cpp.js
	build/src/mode-clojure-noconflict.js
	build/src/mode-clojure.js
	build/src/mode-coldfusion-noconflict.js
	build/src/mode-coldfusion.js
	build/src/mode-csharp-noconflict.js
	build/src/mode-csharp.js
	build/src/mode-css-noconflict.js
	build/src/mode-css.js
	build/src/mode-groovy-noconflict.js
	build/src/mode-groovy.js
	build/src/mode-haxe-noconflict.js
	build/src/mode-haxe.js
	build/src/mode-html-noconflict.js
	build/src/mode-html.js
	build/src/mode-java-noconflict.js
	build/src/mode-java.js
	build/src/mode-javascript-noconflict.js
	build/src/mode-javascript.js
	build/src/mode-json-noconflict.js
	build/src/mode-json.js
	build/src/mode-markdown-noconflict.js
	build/src/mode-markdown.js
	build/src/mode-php-noconflict.js
	build/src/mode-php.js
	build/src/mode-powershell-noconflict.js
	build/src/mode-powershell.js
	build/src/mode-scad-noconflict.js
	build/src/mode-scad.js
	build/src/mode-scala-noconflict.js
	build/src/mode-scala.js
	build/src/mode-svg-noconflict.js
	build/src/mode-svg.js
	build/src/mode-xml-noconflict.js
	build/src/mode-xml.js
This commit is contained in:
Ruben Daniels 2012-04-08 13:22:50 +02:00
commit fddab9eef0
335 changed files with 25170 additions and 11632 deletions

View file

@ -60,13 +60,13 @@ dom.importCssString(editorCss, "ace_editor");
var VirtualRenderer = function(container, theme) {
var _self = this;
this.container = container;
// TODO: this breaks rendering in Cloud9 with multiple ace instances
// // Imports CSS once per DOM document ('ace_editor' serves as an identifier).
// dom.importCssString(editorCss, "ace_editor", container.ownerDocument);
dom.addCssClass(container, "ace_editor");
this.setTheme(theme);
@ -84,8 +84,8 @@ var VirtualRenderer = function(container, theme) {
this.scroller.appendChild(this.content);
this.$gutterLayer = new GutterLayer(this.$gutter);
this.$gutterLayer.on("changeGutterWidth", this.onResize.bind(this, true));
this.$gutterLayer.on("changeGutterWidth", this.onResize.bind(this, true));
this.$markerBack = new MarkerLayer(this.content);
var textLayer = this.$textLayer = new TextLayer(this.content);
@ -112,7 +112,7 @@ var VirtualRenderer = function(container, theme) {
this.scrollTop = 0;
this.scrollLeft = 0;
event.addListener(this.scroller, "scroll", function() {
var scrollLeft = _self.scroller.scrollLeft;
_self.scrollLeft = scrollLeft;
@ -362,7 +362,7 @@ var VirtualRenderer = function(container, theme) {
// this persists in IE9
if (useragent.isIE)
return;
if (this.layerConfig.lastRow === 0)
return;
@ -438,13 +438,13 @@ var VirtualRenderer = function(container, theme) {
// horizontal scrolling
if (changes & this.CHANGE_H_SCROLL) {
this.scroller.scrollLeft = this.scrollLeft;
// read the value after writing it since the value might get clipped
var scrollLeft = this.scroller.scrollLeft;
this.scrollLeft = scrollLeft;
this.session.setScrollLeft(scrollLeft);
}
// full
if (changes & this.CHANGE_FULL) {
this.$textLayer.checkForSizeChanges();
@ -657,12 +657,18 @@ var VirtualRenderer = function(container, theme) {
this.$cursorLayer.showCursor();
};
this.scrollCursorIntoView = function() {
this.scrollSelectionIntoView = function(anchor, lead) {
// first scroll anchor into view then scroll lead into view
this.scrollCursorIntoView(anchor);
this.scrollCursorIntoView(lead);
};
this.scrollCursorIntoView = function(cursor) {
// the editor is not visible
if (this.$size.scrollerHeight === 0)
return;
var pos = this.$cursorLayer.getPixelPosition();
var pos = this.$cursorLayer.getPixelPosition(cursor);
var left = pos.left;
var top = pos.top;
@ -851,7 +857,7 @@ var VirtualRenderer = function(container, theme) {
this._loadTheme = function(name, callback) {
if (!config.get("packaged"))
return callback();
var base = name.split("/").pop();
var filename = config.get("themePath") + "/theme-" + base + config.get("suffix");
net.loadScript(filename, callback);
@ -863,14 +869,14 @@ var VirtualRenderer = function(container, theme) {
this.$themeValue = theme;
if (!theme || typeof theme == "string") {
var moduleName = theme || "ace/theme/textmate";
var module;
try {
module = require(moduleName);
} catch (e) {};
if (module)
return afterLoad(module);
_self._loadTheme(moduleName, function() {
require([theme], function(module) {
if (_self.$themeValue !== theme)