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):
|
||||
* Fabian Jakobs <fabian AT ajax DOT org>
|
||||
* 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
|
||||
* 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.svg.addFold(new Range(1, 0, 7, 0), "fold...");
|
||||
|
||||
docs.plain.addFold(new Range(0, 90, 2, 30), "fold");
|
||||
window.s = docs.js;
|
||||
window.e = env.editor;
|
||||
setTimeout(function() {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
<td align="right">
|
||||
<label for="doc">Document:</label>
|
||||
<select id="doc" size="1">
|
||||
<option value="plain">Text Document</option>
|
||||
<option value="svg">SVG Document</option>
|
||||
<option value="js">JavaScript Document</option>
|
||||
<option value="html">HTML Document</option>
|
||||
|
|
@ -28,7 +29,6 @@
|
|||
<option value="c_cpp">C++ Document</option>
|
||||
|
||||
<option value="textile">Textile Document</option>
|
||||
<option value="plain">Text Document</option>
|
||||
</select>
|
||||
</td>
|
||||
<td align="right">
|
||||
|
|
|
|||
|
|
@ -1005,30 +1005,38 @@ var EditSession = function(text, mode) {
|
|||
var tokens;
|
||||
var foldLine;
|
||||
|
||||
for (var row = firstRow; row <= lastRow; row++) {
|
||||
var row = firstRow;
|
||||
while (row <= lastRow) {
|
||||
foldLine = this.getFoldLine(row);
|
||||
if (!foldLine) {
|
||||
tokens = this.$getDisplayTokens(lang.stringTrimRight(lines[row]));
|
||||
} else {
|
||||
tokens = [];
|
||||
foldLine.walk(function(placeholder, row, column, lastColumn) {
|
||||
var walkTokens;
|
||||
if (placeholder) {
|
||||
walkTokens = this.$getDisplayTokens(placeholder, tokens.length);
|
||||
walkTokens[0] = PLACEHOLDER_START;
|
||||
for (var i = 1; i < walkTokens.length; i++) {
|
||||
walkTokens[i] = PLACEHOLDER_BODY;
|
||||
foldLine.walk(
|
||||
function(placeholder, row, column, lastColumn) {
|
||||
var walkTokens;
|
||||
if (placeholder) {
|
||||
walkTokens = this.$getDisplayTokens(
|
||||
placeholder, tokens.length);
|
||||
walkTokens[0] = PLACEHOLDER_START;
|
||||
for (var i = 1; i < walkTokens.length; i++) {
|
||||
walkTokens[i] = PLACEHOLDER_BODY;
|
||||
}
|
||||
} else {
|
||||
walkTokens = this.$getDisplayTokens(
|
||||
lines[row].substring(lastColumn, column),
|
||||
tokens.length);
|
||||
}
|
||||
} else {
|
||||
walkTokens = this.$getDisplayTokens(
|
||||
lines[row].substring(lastColumn, column),
|
||||
tokens.length);
|
||||
}
|
||||
tokens = tokens.concat(walkTokens);
|
||||
}.bind(this), row, lines[row].length);
|
||||
tokens = tokens.concat(walkTokens);
|
||||
}.bind(this),
|
||||
foldLine.end.row,
|
||||
lines[foldLine.end.row].length
|
||||
);
|
||||
}
|
||||
wrapData[row] =
|
||||
this.$computeWrapSplits(tokens, wrapLimit, tabSize);
|
||||
|
||||
row = this.getRowFoldEnd(row) + 1;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -501,7 +501,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
};
|
||||
|
||||
// For debugging.
|
||||
// console.log(JSON.stringify(layerConfig));
|
||||
console.log(JSON.stringify(layerConfig));
|
||||
|
||||
this.$gutterLayer.element.style.marginTop = (-offset) + "px";
|
||||
this.content.style.marginTop = (-offset) + "px";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue