Merge pull request #1140 from ajaxorg/hotfix/renderer
Fix bug in rowCache
This commit is contained in:
commit
f3d0096050
4 changed files with 52 additions and 13 deletions
|
|
@ -244,7 +244,7 @@ var EditSession = function(text, mode) {
|
|||
return mid;
|
||||
}
|
||||
|
||||
return low && low -1;
|
||||
return low -1;
|
||||
};
|
||||
|
||||
this.resetCaches = function() {
|
||||
|
|
@ -2164,12 +2164,13 @@ var EditSession = function(text, mode) {
|
|||
|
||||
var rowCache = this.$screenRowCache;
|
||||
var i = this.$getRowCacheIndex(rowCache, screenRow);
|
||||
if (0 < i && i < rowCache.length) {
|
||||
var l = rowCache.length;
|
||||
if (l && i >= 0) {
|
||||
var row = rowCache[i];
|
||||
var docRow = this.$docRowCache[i];
|
||||
var doCache = screenRow > row || (screenRow == row && i == rowCache.length - 1);
|
||||
var doCache = screenRow > rowCache[l - 1];
|
||||
} else {
|
||||
var doCache = i != 0 || !rowCache.length;
|
||||
var doCache = !l;
|
||||
}
|
||||
|
||||
var maxRow = this.getLength() - 1;
|
||||
|
|
@ -2189,6 +2190,7 @@ var EditSession = function(text, mode) {
|
|||
foldStart = foldLine ? foldLine.start.row : Infinity;
|
||||
}
|
||||
}
|
||||
|
||||
if (doCache) {
|
||||
this.$docRowCache.push(docRow);
|
||||
this.$screenRowCache.push(row);
|
||||
|
|
@ -2269,12 +2271,13 @@ var EditSession = function(text, mode) {
|
|||
|
||||
var rowCache = this.$docRowCache;
|
||||
var i = this.$getRowCacheIndex(rowCache, docRow);
|
||||
if (0 < i && i < rowCache.length) {
|
||||
var l = rowCache.length;
|
||||
if (l && i >= 0) {
|
||||
var row = rowCache[i];
|
||||
var screenRow = this.$screenRowCache[i];
|
||||
var doCache = docRow > row || (docRow == row && i == rowCache.length - 1);
|
||||
var doCache = docRow > rowCache[l - 1];
|
||||
} else {
|
||||
var doCache = i != 0 || !rowCache.length;
|
||||
var doCache = !l;
|
||||
}
|
||||
|
||||
var foldLine = this.getNextFoldLine(row);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue