From d355ab4b00a580a4540edb34f84c767d3b7dd389 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Thu, 9 Aug 2007 11:19:08 +0000 Subject: [PATCH] Hides end-of-line characters git-svn-id: http://macvim.googlecode.com/svn/trunk@109 96c4425d-ca35-0410-94e5-3396d5c13a8f --- MMTypesetter.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MMTypesetter.m b/MMTypesetter.m index 2ab3af4bbf..f1140e9b24 100644 --- a/MMTypesetter.m +++ b/MMTypesetter.m @@ -28,7 +28,7 @@ // Layout glyphs so that each glyph takes up exactly one cell. // // The width of a cell is determined by [MMTextStorage cellWidth] (which -// typically sets one cell to equal the width of 'W' in the current font), and +// typically sets one cell to equal the width of 'm' in the current font), and // the height of a cell is given by the default line height for the current // font. // @@ -93,7 +93,6 @@ [lm setTextContainer:tc forGlyphRange:glyphRange]; [lm setLineFragmentRect:lineRect forGlyphRange:glyphRange usedRect:lineRect]; - //[lm setLocation:glyphPt forStartOfGlyphRange:glyphRange]; // Position each glyph individually to ensure they take up exactly one // cell. @@ -102,10 +101,11 @@ glyphPt.x += cellWidth; } - // Hide non-zero space characters (there is one after every wide - // character). + // Hide end-of-line and non-zero space characters (there is one after + // every wide character). for (j = lineRange.location; j < endLineIdx; ++j) { - if ([text characterAtIndex:j] == 0x200b) { + unichar ch = [text characterAtIndex:j]; + if (ch == 0x200b || ch == '\n') { NSRange range = { j, 1 }; range = [lm glyphRangeForCharacterRange:range actualCharacterRange:nil];