Skip to content

Commit 1a336e4

Browse files
authored
Skip checking for RTL chunks which are basic ASCII (microsoft#175222)
Skip checking for RTL chunks which are basic ASCII (microsoft#174939)
1 parent 1516c2b commit 1a336e4

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,15 @@ export class PieceTreeTextBufferBuilder implements ITextBufferBuilder {
141141
this.lf += lineStarts.lf;
142142
this.crlf += lineStarts.crlf;
143143

144-
if (this.isBasicASCII) {
145-
this.isBasicASCII = lineStarts.isBasicASCII;
146-
}
147-
if (!this.isBasicASCII && !this.containsRTL) {
148-
// No need to check if it is basic ASCII
149-
this.containsRTL = strings.containsRTL(chunk);
150-
}
151-
if (!this.isBasicASCII && !this.containsUnusualLineTerminators) {
152-
// No need to check if it is basic ASCII
153-
this.containsUnusualLineTerminators = strings.containsUnusualLineTerminators(chunk);
144+
if (!lineStarts.isBasicASCII) {
145+
// this chunk contains non basic ASCII characters
146+
this.isBasicASCII = false;
147+
if (!this.containsRTL) {
148+
this.containsRTL = strings.containsRTL(chunk);
149+
}
150+
if (!this.containsUnusualLineTerminators) {
151+
this.containsUnusualLineTerminators = strings.containsUnusualLineTerminators(chunk);
152+
}
154153
}
155154
}
156155

0 commit comments

Comments
 (0)