Skip to content

Conversation

@hontd
Copy link

@hontd hontd commented Oct 5, 2023

No description provided.

Copy link
Owner

@rajdeep rajdeep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hontd, thank you for making this change.

var handled: Bool = false
presses.forEach { press in
guard let key = press.key else { return }
if key.charactersIgnoringModifiers == UIKeyCommand.inputUpArrow {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hontd, if we keep a mapping of UIKeyCommand with EditorKey, we can get this if-else condition down to a single line without duplicating richTextViewDelegate?.richTextView(self, shouldHandle:. It would be easier to maintain then.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it would be great to add some tests here. Checkout RichTextViewContextTests for examples.

@hontd hontd force-pushed the support-key-commands branch from 0a36d11 to 566fe54 Compare October 9, 2023 02:21
@hontd hontd force-pushed the support-key-commands branch from 566fe54 to be3e8af Compare October 9, 2023 03:35
rajdeep
rajdeep previously approved these changes Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants