mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-10-26 19:10:11 +03:00
Fix line number count in line numbers view (fix #524)
This commit is contained in:
parent
135385e70f
commit
4a5b6fa92f
@ -30,6 +30,7 @@ develop
|
||||
|
||||
- Fix an issue where “Delimit by whitespace” option on text find didn't work.
|
||||
- Fix an issue where some document file information displayed wrong after saving.
|
||||
- Fix an issue where line number view could count wrong if wrapped.
|
||||
- Fix an issue where “ignore case” option in syntax style definition didn't actually ignore case.
|
||||
- Fix an issue where the current file extension was omitted from new suggested file name on “Save As…” operation.
|
||||
- Fix some typos in German localization. (Thanks to Chris Eidhof!)
|
||||
|
@ -260,12 +260,12 @@ static CGFontRef BoldLineNumberFont;
|
||||
|
||||
// counters
|
||||
NSUInteger glyphCount = visibleGlyphRange.location;
|
||||
NSUInteger lineNumber = 1;
|
||||
NSUInteger lineNumber = 0;
|
||||
NSUInteger lastLineNumber = 0;
|
||||
|
||||
// count lines until visible
|
||||
lineNumber += [string numberOfLinesInRange:NSMakeRange(0, [layoutManager characterIndexForGlyphAtIndex:visibleGlyphRange.location])
|
||||
includingLastNewLine:NO];
|
||||
lineNumber = [string numberOfLinesInRange:NSMakeRange(0, [layoutManager characterIndexForGlyphAtIndex:visibleGlyphRange.location])
|
||||
includingLastNewLine:YES] ?: 1; // start with 1
|
||||
|
||||
// draw visible line numbers
|
||||
for (NSUInteger glyphIndex = visibleGlyphRange.location; glyphIndex < NSMaxRange(visibleGlyphRange); lineNumber++) { // count "real" lines
|
||||
|
Loading…
Reference in New Issue
Block a user