-
Notifications
You must be signed in to change notification settings - Fork 83
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
Support directional key commands #227
base: main
Are you sure you want to change the base?
Conversation
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.
@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 { |
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.
@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.
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.
Also, it would be great to add some tests here. Checkout RichTextViewContextTests
for examples.
0a36d11
to
566fe54
Compare
566fe54
to
be3e8af
Compare
No description provided.