U+2028 and U+2029 render as squares instead of causing line break.

git-svn-id: http://macvim.googlecode.com/svn/trunk@222 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
Bjorn Winckler
2007-08-31 07:37:44 +00:00
parent bd8505d54f
commit fb42853d27
3 changed files with 30 additions and 0 deletions
+2
View File
@@ -36,6 +36,8 @@
- (int)maxRows;
- (int)maxColumns;
- (int)actualRows;
- (int)actualColumns;
- (void)getMaxRows:(int*)rows columns:(int*)cols;
- (void)setMaxRows:(int)rows columns:(int)cols;
- (void)replaceString:(NSString *)string atRow:(int)row column:(int)col
+10
View File
@@ -143,6 +143,16 @@
return maxColumns;
}
- (int)actualRows
{
return actualRows;
}
- (int)actualColumns
{
return actualColumns;
}
- (void)getMaxRows:(int*)rows columns:(int*)cols
{
if (rows) *rows = maxRows;
+18
View File
@@ -13,6 +13,8 @@
#import "MacVim.h"
#define MM_USE_LINERANGE 0
#if 0
@interface MMTypesetter (Private)
@@ -61,6 +63,7 @@
unsigned i, numberOfLines = 0, firstLine = 0;
NSRange firstLineRange = { 0, 0 };
#if MM_USE_LINERANGE
// Find the first line and its range, and count the number of lines. (This
// info could also be gleaned from MMTextStorage, but we do it here anyway
// to make absolutely sure everything is right.)
@@ -73,6 +76,14 @@
i = NSMaxRange(lineRange);
}
#else
unsigned stride = 1 + [ts actualColumns];
numberOfLines = [ts actualRows];
firstLine = (unsigned)(startCharIdx/stride);
firstLineRange.location = firstLine * stride;
unsigned len = [text length] - firstLineRange.location;
firstLineRange.length = len < stride ? len : stride;
#endif
// Perform line fragment generation one line at a time.
NSRange lineRange = firstLineRange;
@@ -105,7 +116,14 @@
}
}
#if MM_USE_LINERANGE
lineRange = [text lineRangeForRange:NSMakeRange(endLineIdx, 0)];
#else
lineRange.location = endLineIdx;
len = [text length] - lineRange.location;
if (len < lineRange.length)
lineRange.length = len;
#endif
}
if (nextGlyph)