fix rowcache not working for row 1
This commit is contained in:
parent
0a14538bbe
commit
9ab80ddced
2 changed files with 40 additions and 14 deletions
|
|
@ -172,14 +172,14 @@ var EditSession = function(text, mode) {
|
|||
*
|
||||
*
|
||||
**/
|
||||
this.$resetRowCache = function(docRrow) {
|
||||
if (!docRrow) {
|
||||
this.$resetRowCache = function(docRow) {
|
||||
if (!docRow) {
|
||||
this.$docRowCache = [];
|
||||
this.$screenRowCache = [];
|
||||
return;
|
||||
}
|
||||
|
||||
var i = this.$getRowCacheIndex(this.$docRowCache, docRrow) + 1;
|
||||
var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1;
|
||||
var l = this.$docRowCache.length;
|
||||
this.$docRowCache.splice(i, l);
|
||||
this.$screenRowCache.splice(i, l);
|
||||
|
|
@ -1808,10 +1808,8 @@ var EditSession = function(text, mode) {
|
|||
};
|
||||
|
||||
this.$updateRowLengthCache = function(firstRow, lastRow, b) {
|
||||
//console.log(firstRow, lastRow, b)
|
||||
this.$rowLengthCache[firstRow] = null;
|
||||
this.$rowLengthCache[lastRow] = null;
|
||||
//console.log(this.$rowLengthCache)
|
||||
};
|
||||
|
||||
/** internal, hide
|
||||
|
|
@ -2191,7 +2189,7 @@ var EditSession = function(text, mode) {
|
|||
var docRow = this.$docRowCache[i];
|
||||
var doCache = screenRow > row || (screenRow == row && i == rowCache.length - 1);
|
||||
} else {
|
||||
var doCache = true;
|
||||
var doCache = i != 0 || !rowCache.length;
|
||||
}
|
||||
|
||||
var maxRow = this.getLength() - 1;
|
||||
|
|
@ -2296,7 +2294,7 @@ var EditSession = function(text, mode) {
|
|||
var screenRow = this.$screenRowCache[i];
|
||||
var doCache = docRow > row || (docRow == row && i == rowCache.length - 1);
|
||||
} else {
|
||||
var doCache = true;
|
||||
var doCache = i != 0 || !rowCache.length;
|
||||
}
|
||||
|
||||
var foldLine = this.getNextFoldLine(row);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue