Skip to content

Commit 99c263e

Browse files
committed
Fixed rendering Emoji
1 parent 026c4d5 commit 99c263e

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/MacVim/MMCoreTextView.m

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,19 +1037,16 @@ - (void)batchDrawData:(NSData *)data
10371037
gatherGlyphs(CGGlyph glyphs[], UniCharCount count)
10381038
{
10391039
// Gather scattered glyphs that was happended by Surrogate pair chars
1040-
UniCharCount glyphLength = 0;
1041-
NSUInteger pos = NSIntegerMax;
1040+
UniCharCount glyphCount = 0;
1041+
NSUInteger pos = 0;
10421042
NSUInteger i;
10431043
for (i = 0; i < count; ++i) {
1044-
if (glyphs[i] == 0) {
1045-
pos = i;
1046-
} else {
1047-
++glyphLength;
1048-
if (pos != NSIntegerMax)
1049-
glyphs[pos++] = glyphs[i];
1044+
if (glyphs[i] != 0) {
1045+
++glyphCount;
1046+
glyphs[pos++] = glyphs[i];
10501047
}
10511048
}
1052-
return glyphLength;
1049+
return glyphCount;
10531050
}
10541051

10551052
static void

0 commit comments

Comments
 (0)