Fix range to use characters and not glyphs, sicne highlighting is based on chars.

This commit is contained in:
Riccardo Mottola 2020-04-16 23:45:12 +02:00
parent 8b48d77cbb
commit 75785db7e4
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2020-04-16 Riccardo Mottola <rm@gnu.org>
* Modules/Editors/ProjectCenter/PCEditorView.m:(drawRect:)
Fix range to use characters and not glyphs, sicne highlighting is based on chars.
2020-03-24 Riccardo Mottola <rm@gnu.org>
* Framework/PCProjectLauncher.m

View file

@ -455,12 +455,14 @@ static int ComputeIndentingOffset(NSString * string, unsigned int start)
- (void)drawRect:(NSRect)r
{
NSRange drawnRange;
if (highlighter)
{
NSRange drawnRange;
drawnRange = [[self layoutManager]
glyphRangeForBoundingRect:r inTextContainer:[self textContainer]];
drawnRange = [[self layoutManager] characterRangeForGlyphRange:drawnRange
actualGlyphRange:NULL];
[highlighter highlightRange:drawnRange];
}