mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 08:38:56 +01:00
Fix issue when areas with 0 tokens would be used for delta encoding
This commit is contained in:
@@ -746,6 +746,10 @@ export class SemanticColoringAdapter {
|
||||
for (let i = 0, len = oldAreas.length; i < len; i++) {
|
||||
const oldAreaData = oldAreas[i];
|
||||
const oldAreaTokenCount = (oldAreaData.length / 5) | 0;
|
||||
if (oldAreaTokenCount === 0) {
|
||||
// skip old empty areas
|
||||
continue;
|
||||
}
|
||||
if (newTokenEndIndex - newTokenStartIndex < oldAreaTokenCount) {
|
||||
// there are too many old tokens, this cannot work
|
||||
break;
|
||||
@@ -772,6 +776,10 @@ export class SemanticColoringAdapter {
|
||||
for (let i = oldAreas.length - 1; i >= 0; i--) {
|
||||
const oldAreaData = oldAreas[i];
|
||||
const oldAreaTokenCount = (oldAreaData.length / 5) | 0;
|
||||
if (oldAreaTokenCount === 0) {
|
||||
// skip old empty areas
|
||||
continue;
|
||||
}
|
||||
if (newTokenEndIndex - newTokenStartIndex < oldAreaTokenCount) {
|
||||
// there are too many old tokens, this cannot work
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user