-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add support for codeblock on iOS #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add support for codeblock on iOS #253
Conversation
szydlovsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting there!
| return NO; | ||
| } | ||
|
|
||
| + (BOOL)handleNewlineBackspaceInRange:(NSRange)range replacementText:(NSString *)text input:(id)input { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add some verbose comment what that function does and why it needs to run as a last of the callbacks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add comment with explanation. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 💣
| ]; | ||
|
|
||
| return manualLinkRange.length == 0 ? automaticLinkRange : manualLinkRange; | ||
| return manualUrl == nil ? automaticLinkRange : manualLinkRange; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the sake of safety I'd also assign automaticUrl to the automatic link range search result and do something like;
| return manualUrl == nil ? automaticLinkRange : manualLinkRange; | |
| return | |
| manualLink == nullptr | |
| ? automaticLink == nullptr ? NSMakeRange(0,0) : automaticLinkRange | |
| : manualLinkRange; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't happen but if the internals of some iOS function change again it will be less chaotic (:
| withInput:(EnrichedTextInputView* _Nonnull)input | ||
| inRange:(NSRange)range | ||
| withCondition:(BOOL (NS_NOESCAPE ^_Nonnull)(id _Nullable value, NSRange range))condition; | ||
| + (NSArray *_Nonnull)getRangesWithout:(NSArray<NSNumber *> *_Nonnull)types withInput:(EnrichedTextInputView* _Nonnull)input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please spread the arguments into different lines as in all the other functions?
| return occurences; | ||
| } | ||
|
|
||
| + (NSArray *_Nonnull)getRangesWithout:(NSArray<NSNumber *> *_Nonnull)types withInput:(EnrichedTextInputView* _Nonnull)input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguments spreading would also be cool here if we keep it that way in the file. Some objc linter will eventually fix it though so not a big deal 😄
Summary
Add support for
codeblock.Test Plan
Run Example app and play with
codeblockScreenshots
Compatibility