-
Notifications
You must be signed in to change notification settings - Fork 208
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: add regex and case sensitive to FindReplaceMenu
#480
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #480 +/- ##
==========================================
- Coverage 80.41% 80.29% -0.12%
==========================================
Files 281 281
Lines 11863 11928 +65
==========================================
+ Hits 9540 9578 +38
- Misses 2323 2350 +27
☔ View full report in Codecov by Sentry. |
Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com>
…owy-editor into find-replace-feat
|
||
@override | ||
Iterable<Match> searchMethod(Pattern pattern, String text) { | ||
if (pattern is String) { |
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.
@sun-jiao @Xazin, do we need to create a Mixture class?
If DartBuiltin
works in all cases, we should just use that, since it is faster.
And keep BoyerMoore
as an example for the developer if they want to implement their own algorithm.
Also then, we could remove the BoyerMoore
implementation from the code and only show it in Docs as an example.
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.
My tests showed BoyerMoore to be slightly slower. But auto-generated random strings were used in my tests.
I think BoyerMoore should be more efficient for natural language. Because most languages that use alphabetic scripts have prefixes and suffixes that are shared between different words.
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 have read some articles or papers on Boyer-Moore style regex search algorithm. But they're not as concise as the original Boyer-Moore.
Rust community also has a similar issue. rust-lang/regex#197
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.
They have already implemented it: rust-lang/regex#419. I'll take a look tomorrow.
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 took a brief look and this still seems to be a plain text search algorithm, not regex. Even though it's in the regex carte.
I did some test for natural language.
result:
Interesting, dart built-in |
@MayurSMahajan @Xazin Done. Already converted them to svg files. And I added some test cases for regex replace and case sensitive. |
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 Good to me.
Hi, any updates on this? |
I will take a look soon 👍 |
Hey @sun-jiao, sorry about the delay, my colleague was working on some improvements for the find-replace feature, so I was waiting to see how those changes would impact this PR. Can you rebase on the latest |
Hello, I am traveling during the China National Day holiday. I will update the branch as soon as possible after the trip. |
No worries, hope you enjoy the trip 👌 |
@Xazin Already merged the main branch to this PR. |
Thanks @sun-jiao. LGTM. |
* main: fix: unable to clear the style by toggling twice (AppFlowy-IO#532) fix: pinyin IME on Linux (AppFlowy-IO#531) fix: background color issues (AppFlowy-IO#530) fix: cursor blink at wrong location when inserting text (AppFlowy-IO#529) feat: enable toggling and canceling of the formatting with shortcuts (AppFlowy-IO#528) chore: bump version 1.4.4 (AppFlowy-IO#527) fix: the selection handles remain on the screen after cutting the text (AppFlowy-IO#526) fix: the selection should be clear if header or footer is focusing (AppFlowy-IO#525) feat: customize desktop toolbar style (AppFlowy-IO#519) feat: add regex and case sensitive to `FindReplaceMenu` (AppFlowy-IO#480) feat: export JSON in mobile and update mobile_example.json (AppFlowy-IO#515) feat: support customizing error block (AppFlowy-IO#524) fix: impossible to click on any sub-items if the top level item is off-screen (AppFlowy-IO#522)
No description provided.