Skip to content
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

feat: support formatting greater hyphen to single arrow #665

Merged

Conversation

Jayaprakash-dev
Copy link
Contributor

@Jayaprakash-dev Jayaprakash-dev commented Jan 10, 2024

This PR is related to feature request made in AppFlowy-IO/AppFlowy repo

[issue]: [FR] - + > then → #4277

Added a feature that enable users to type - + > to insert → in the editor

@Xazin
Copy link
Collaborator

Xazin commented Jan 10, 2024

The CI fails, can you format the files with the dart formatter?

We use 80 character line length, if you have upped it in your local environment you might have to change it back to 80 and then format the files.

@Jayaprakash-dev
Copy link
Contributor Author

I've formatted the code file using dart SDK formatter.

Copy link

codecov bot commented Jan 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3d373be) 76.47% compared to head (abe8e43) 76.49%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #665      +/-   ##
==========================================
+ Coverage   76.47%   76.49%   +0.01%     
==========================================
  Files         295      295              
  Lines       13046    13074      +28     
==========================================
+ Hits         9977    10001      +24     
- Misses       3069     3073       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -97,6 +97,9 @@ final List<CharacterShortcutEvent> standardCharacterShortcutEvents = [

// convert => to arrow
formatGreaterEqual,

// convert -> to single arrow (→)
formatGreaterHyphen,
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO, it should not be added to the standard shortcuts as it is not a commonly used shortcut.

Copy link
Contributor Author

@Jayaprakash-dev Jayaprakash-dev Jan 11, 2024

Choose a reason for hiding this comment

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

@LucasXu0, I thought it was fine to include formatGreaterHyphen in the standardCharacterShortcutEvents list since it already includes formatGreaterEqual. However, if you suggest not adding formatGreaterHyphen there, an alternative approach would be to include it in the characterShortcutEvents list within the AppFlowyEditorPage class located in AppFlowy-IO/AppFlowy repo.

If you're okay with that, then I could close the current pull request and submit a new one in AppFlowy repo.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Including it in the editor is fine, you can remove it from the standard shortcuts, then in AppFlowy we can selectively pick it if need be.

Copy link
Contributor Author

@Jayaprakash-dev Jayaprakash-dev Jan 11, 2024

Choose a reason for hiding this comment

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

@Xazin, sure I'll commit those changes, btw there's currently no test case for formatting greater equal to double arrow = + > to insert ⇒. If you'd like, I can also write a test case for that scenario.

@Jayaprakash-dev Jayaprakash-dev force-pushed the feat_format_greater_hyphen_to_arrow branch from 060548b to cafbf89 Compare January 11, 2024 15:21
@LucasXu0 LucasXu0 merged commit dccd4e8 into AppFlowy-IO:main Jan 14, 2024
11 checks passed
q200892907 added a commit to q200892907/appflowy-editor that referenced this pull request Jan 15, 2024
* main:
  feat: support formatting greater hyphen to single arrow (AppFlowy-IO#665)
  feat: backslash to ignore shortcut event (AppFlowy-IO#635)
  fix: solve the problem that Chinese ime cannot continue deleting after deleting input content (AppFlowy-IO#672)

# Conflicts:
#	lib/src/editor/editor_component/service/ime/non_delta_input_service.dart
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