This commit is contained in:
Colton Voege 2014-09-25 12:54:50 -04:00
commit a33cc3223a
9 changed files with 85820 additions and 85710 deletions

View file

@ -74,7 +74,7 @@ var FontMetrics = exports.FontMetrics = function(parentEl, interval) {
document.documentElement.appendChild(el);
var w = el.getBoundingClientRect().width;
if (w > 0 && w < 1)
CHAR_COUNT = 1;
CHAR_COUNT = 50;
else
CHAR_COUNT = 100;
el.parentNode.removeChild(el);
@ -127,7 +127,7 @@ var FontMetrics = exports.FontMetrics = function(parentEl, interval) {
};
this.$measureSizes = function() {
if (CHAR_COUNT === 1) {
if (CHAR_COUNT === 50) {
var rect = null;
try {
rect = this.$measureNode.getBoundingClientRect();
@ -136,7 +136,7 @@ var FontMetrics = exports.FontMetrics = function(parentEl, interval) {
};
var size = {
height: rect.height,
width: rect.width
width: rect.width / CHAR_COUNT
};
} else {
var size = {

View file

@ -43,7 +43,7 @@ var HtmlCompletions = require("./html_completions").HtmlCompletions;
var WorkerClient = require("../worker/worker_client").WorkerClient;
// http://www.w3.org/TR/html5/syntax.html#void-elements
var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];
var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
var Mode = function(options) {

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -816,10 +816,15 @@ var VirtualRenderer = function(container, theme) {
// lines may have been pushed down. If so, the first screen row will not
// have changed, but the first actual row will. In that case, adjust
// scrollTop so that the cursor and onscreen content stays in the same place.
// TODO: find a better way to handle this, that works non wrapped case and doesn't compute layerConfig twice
if (config.firstRow != this.layerConfig.firstRow && config.firstRowScreen == this.layerConfig.firstRowScreen) {
this.scrollTop = this.scrollTop + (config.firstRow - this.layerConfig.firstRow) * this.lineHeight;
changes = changes | this.CHANGE_SCROLL;
changes |= this.$computeLayerConfig();
var st = this.scrollTop + (config.firstRow - this.layerConfig.firstRow) * this.lineHeight;
if (st > 0) {
// this check is needed as a workaround for the documentToScreenRow returning -1 if document.length == 0
this.scrollTop = st;
changes = changes | this.CHANGE_SCROLL;
changes |= this.$computeLayerConfig();
}
}
config = this.layerConfig;
// update scrollbar first to not lose scroll position when gutter calls resize