33#import " FontExtension.h"
44#import " OccurenceUtils.h"
55#import " ParagraphsUtils.h"
6+ #import " ColorExtension.h"
67
78@implementation InlineCodeStyle {
89 EnrichedTextInputView *_input;
@@ -33,7 +34,7 @@ - (void)addAttributes:(NSRange)range {
3334 NSRange currentRange = [value rangeValue ];
3435 [_input->textView.textStorage beginEditing ];
3536
36- [_input->textView.textStorage addAttribute: NSBackgroundColorAttributeName value: [[_input->config inlineCodeBgColor ] colorWithAlphaComponent :0.4 ] range: currentRange];
37+ [_input->textView.textStorage addAttribute: NSBackgroundColorAttributeName value: [[_input->config inlineCodeBgColor ] colorWithAlphaIfNotTransparent :0.4 ] range: currentRange];
3738 [_input->textView.textStorage addAttribute: NSForegroundColorAttributeName value: [_input->config inlineCodeFgColor ] range: currentRange];
3839 [_input->textView.textStorage addAttribute: NSUnderlineColorAttributeName value: [_input->config inlineCodeFgColor ] range: currentRange];
3940 [_input->textView.textStorage addAttribute: NSStrikethroughColorAttributeName value: [_input->config inlineCodeFgColor ] range: currentRange];
@@ -53,7 +54,7 @@ - (void)addAttributes:(NSRange)range {
5354
5455- (void )addTypingAttributes {
5556 NSMutableDictionary *newTypingAttrs = [_input->textView.typingAttributes mutableCopy ];
56- newTypingAttrs[NSBackgroundColorAttributeName ] = [[_input->config inlineCodeBgColor ] colorWithAlphaComponent :0.4 ];
57+ newTypingAttrs[NSBackgroundColorAttributeName ] = [[_input->config inlineCodeBgColor ] colorWithAlphaIfNotTransparent :0.4 ];
5758 newTypingAttrs[NSForegroundColorAttributeName ] = [_input->config inlineCodeFgColor ];
5859 newTypingAttrs[NSUnderlineColorAttributeName ] = [_input->config inlineCodeFgColor ];
5960 newTypingAttrs[NSStrikethroughColorAttributeName ] = [_input->config inlineCodeFgColor ];
0 commit comments