Fix bug in updateWrapData. Rendering still sometimes misaligned
This commit is contained in:
parent
79678b5e96
commit
353c6a4f4a
4 changed files with 28 additions and 17 deletions
|
|
@ -21,6 +21,7 @@
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Fabian Jakobs <fabian AT ajax DOT org>
|
* Fabian Jakobs <fabian AT ajax DOT org>
|
||||||
* Kevin Dangoor (kdangoor@mozilla.com)
|
* Kevin Dangoor (kdangoor@mozilla.com)
|
||||||
|
* Julian Viereck <julian DOT viereck AT gmail DOT com>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
|
@ -154,6 +155,8 @@ exports.launch = function(env) {
|
||||||
docs.js.addFold(new Range(1, 10, 2, 10), "foo...");
|
docs.js.addFold(new Range(1, 10, 2, 10), "foo...");
|
||||||
|
|
||||||
docs.svg.addFold(new Range(1, 0, 7, 0), "fold...");
|
docs.svg.addFold(new Range(1, 0, 7, 0), "fold...");
|
||||||
|
|
||||||
|
docs.plain.addFold(new Range(0, 90, 2, 30), "fold");
|
||||||
window.s = docs.js;
|
window.s = docs.js;
|
||||||
window.e = env.editor;
|
window.e = env.editor;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<label for="doc">Document:</label>
|
<label for="doc">Document:</label>
|
||||||
<select id="doc" size="1">
|
<select id="doc" size="1">
|
||||||
|
<option value="plain">Text Document</option>
|
||||||
<option value="svg">SVG Document</option>
|
<option value="svg">SVG Document</option>
|
||||||
<option value="js">JavaScript Document</option>
|
<option value="js">JavaScript Document</option>
|
||||||
<option value="html">HTML Document</option>
|
<option value="html">HTML Document</option>
|
||||||
|
|
@ -28,7 +29,6 @@
|
||||||
<option value="c_cpp">C++ Document</option>
|
<option value="c_cpp">C++ Document</option>
|
||||||
|
|
||||||
<option value="textile">Textile Document</option>
|
<option value="textile">Textile Document</option>
|
||||||
<option value="plain">Text Document</option>
|
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
|
|
|
||||||
|
|
@ -1005,16 +1005,19 @@ var EditSession = function(text, mode) {
|
||||||
var tokens;
|
var tokens;
|
||||||
var foldLine;
|
var foldLine;
|
||||||
|
|
||||||
for (var row = firstRow; row <= lastRow; row++) {
|
var row = firstRow;
|
||||||
|
while (row <= lastRow) {
|
||||||
foldLine = this.getFoldLine(row);
|
foldLine = this.getFoldLine(row);
|
||||||
if (!foldLine) {
|
if (!foldLine) {
|
||||||
tokens = this.$getDisplayTokens(lang.stringTrimRight(lines[row]));
|
tokens = this.$getDisplayTokens(lang.stringTrimRight(lines[row]));
|
||||||
} else {
|
} else {
|
||||||
tokens = [];
|
tokens = [];
|
||||||
foldLine.walk(function(placeholder, row, column, lastColumn) {
|
foldLine.walk(
|
||||||
|
function(placeholder, row, column, lastColumn) {
|
||||||
var walkTokens;
|
var walkTokens;
|
||||||
if (placeholder) {
|
if (placeholder) {
|
||||||
walkTokens = this.$getDisplayTokens(placeholder, tokens.length);
|
walkTokens = this.$getDisplayTokens(
|
||||||
|
placeholder, tokens.length);
|
||||||
walkTokens[0] = PLACEHOLDER_START;
|
walkTokens[0] = PLACEHOLDER_START;
|
||||||
for (var i = 1; i < walkTokens.length; i++) {
|
for (var i = 1; i < walkTokens.length; i++) {
|
||||||
walkTokens[i] = PLACEHOLDER_BODY;
|
walkTokens[i] = PLACEHOLDER_BODY;
|
||||||
|
|
@ -1025,10 +1028,15 @@ var EditSession = function(text, mode) {
|
||||||
tokens.length);
|
tokens.length);
|
||||||
}
|
}
|
||||||
tokens = tokens.concat(walkTokens);
|
tokens = tokens.concat(walkTokens);
|
||||||
}.bind(this), row, lines[row].length);
|
}.bind(this),
|
||||||
|
foldLine.end.row,
|
||||||
|
lines[foldLine.end.row].length
|
||||||
|
);
|
||||||
}
|
}
|
||||||
wrapData[row] =
|
wrapData[row] =
|
||||||
this.$computeWrapSplits(tokens, wrapLimit, tabSize);
|
this.$computeWrapSplits(tokens, wrapLimit, tabSize);
|
||||||
|
|
||||||
|
row = this.getRowFoldEnd(row) + 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -501,7 +501,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
// For debugging.
|
// For debugging.
|
||||||
// console.log(JSON.stringify(layerConfig));
|
console.log(JSON.stringify(layerConfig));
|
||||||
|
|
||||||
this.$gutterLayer.element.style.marginTop = (-offset) + "px";
|
this.$gutterLayer.element.style.marginTop = (-offset) + "px";
|
||||||
this.content.style.marginTop = (-offset) + "px";
|
this.content.style.marginTop = (-offset) + "px";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue