mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 02:32:35 -05:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -242,7 +242,7 @@ class PieceTreeSearchCache {
|
||||
|
||||
public valdiate(offset: number) {
|
||||
let hasInvalidVal = false;
|
||||
let tmp: (CacheEntry | null)[] = this._cache;
|
||||
let tmp: Array<CacheEntry | null> = this._cache;
|
||||
for (let i = 0; i < tmp.length; i++) {
|
||||
let nodePos = tmp[i]!;
|
||||
if (nodePos.node.parent === null || nodePos.nodeStartOffset >= offset) {
|
||||
@@ -254,8 +254,7 @@ class PieceTreeSearchCache {
|
||||
|
||||
if (hasInvalidVal) {
|
||||
let newArr: CacheEntry[] = [];
|
||||
for (let i = 0; i < tmp.length; i++) {
|
||||
const entry = tmp[i];
|
||||
for (const entry of tmp) {
|
||||
if (entry !== null) {
|
||||
newArr.push(entry);
|
||||
}
|
||||
@@ -1042,7 +1041,7 @@ export class PieceTreeBase {
|
||||
while (text.length > AverageBufferSize) {
|
||||
const lastChar = text.charCodeAt(AverageBufferSize - 1);
|
||||
let splitText;
|
||||
if (lastChar === CharCode.CarriageReturn || (lastChar >= 0xd800 && lastChar <= 0xdbff)) {
|
||||
if (lastChar === CharCode.CarriageReturn || (lastChar >= 0xD800 && lastChar <= 0xDBFF)) {
|
||||
// last character is \r or a high surrogate => keep it back
|
||||
splitText = text.substring(0, AverageBufferSize - 1);
|
||||
text = text.substring(AverageBufferSize - 1);
|
||||
|
||||
@@ -103,7 +103,7 @@ export class PieceTreeTextBufferBuilder implements ITextBufferBuilder {
|
||||
}
|
||||
|
||||
const lastChar = chunk.charCodeAt(chunk.length - 1);
|
||||
if (lastChar === CharCode.CarriageReturn || (lastChar >= 0xd800 && lastChar <= 0xdbff)) {
|
||||
if (lastChar === CharCode.CarriageReturn || (lastChar >= 0xD800 && lastChar <= 0xDBFF)) {
|
||||
// last character is \r or a high surrogate => keep it back
|
||||
this._acceptChunk1(chunk.substr(0, chunk.length - 1), false);
|
||||
this._hasPreviousChar = true;
|
||||
|
||||
Reference in New Issue
Block a user