diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 5f14bc14..b2331de4 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -104,7 +104,6 @@ var VirtualRenderer = function(container, theme) { this.$markerFront = new MarkerLayer(this.content); this.$cursorLayer = new CursorLayer(this.content); - this.$cursorPadding = 8; // Indicates whether the horizontal scrollbar is visible this.$horizScroll = false; @@ -1324,18 +1323,19 @@ var VirtualRenderer = function(container, theme) { _self.container.ownerDocument ); - if (_self.$theme) - dom.removeCssClass(_self.container, _self.$theme); + if (_self.theme) + dom.removeCssClass(_self.container, _self.theme.cssClass); - _self.$theme = theme ? theme.cssClass : null; + // this is kept only for backwards compatibility + _self.$theme = theme.cssClass; - if (_self.$theme) - dom.addCssClass(_self.container, _self.$theme); + _self.theme = theme; + dom.addCssClass(_self.container, theme.cssClass); + dom.setCssClass(_self.container, "ace_dark", theme.isDark); - if (theme && theme.isDark) - dom.addCssClass(_self.container, "ace_dark"); - else - dom.removeCssClass(_self.container, "ace_dark"); + var padding = theme.padding || 4; + if (_self.$padding && padding != _self.$padding) + _self.setPadding(padding); // force re-measure of the gutter width if (_self.$size) {