Merge pull request #3180 from daboe01/cptextview-changefont-fix

fixed: crash when changing typing attributes without selection
This commit is contained in:
daboe01 authored and GitHub committed 2026-02-01 19:43:50 +01:00
commit 3be864e50f
1 file changed
+4
+4
View File
@@ -1867,6 +1867,10 @@ Sets the selection to a range of characters in response to user action.
}
else
{
attributes = [_textStorage attributesAtIndex:_selectionRange.location
longestEffectiveRange:_selectionRange
inRange:_selectionRange];
oldFont = [attributes objectForKey:CPFontAttributeName] || [self font];
[_typingAttributes setObject:[sender convertFont:oldFont] forKey:CPFontAttributeName];
}
}