-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add all fixes for search functionality from upstream #286
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reported internally. Potential regex flags are passed as is to RegExp contructor, and in case of failure the query is deemed a plain text one. Related commit: - codemirror/codemirror5@8de67d2#diff-3f4aa453cefa49f6431f1bba3bb53a8e
…ndaries Related issue: - uBlockOrigin/uBlock-issues#493
Also eat backslash for `\\`, to allow searching for literal `\n`, `\t`.
Related issue: - uBlockOrigin/uBlock-issues#768 So that the input fields can gain extra built-in browser widgets useful in search fields. (For now only on Chromium)
Before this commit, CodeMirror's add-on for search occurrences was limited to find at most 1000 first occurrences, because of performance considerations. This commit removes this low limit by having the search occurrences done in a dedicated worker. The limit is now time-based, and highly unlikely to ever be hit under normal condition. With this change, all search occurrences are gathered, and as a result: - All occurrences are reported in the scrollbar instead of just the 1,000 first - The total count of all occurrences is now reported, instead of capping at "1000+". - The current occurrence rank at the cursor or selection position is now reported -- this was not possible to report this before. The number of occurrences is line-based, it's not useful to report finer-grained occurences in uBO.
Related commit: - gorhill/uBlock@2333240 Since the search worker can go away after its time-to-live elapsed, we may need to pass again the haystack on which search operations are performed.
Code review following latest changes. Also, move the input field to the left so that it renders properly on smaller displays and does not jump around when the result position/count numbers change. This also makes it easier to add more functionality to the editor's toolbar in the future.
Added a dotted box around found text occurrences, as just pale yellow to highlight the text is not enough to visually distinguish from surrounding text. Iterating through found text occurrences will now ensure they are vertically positioned in the middle of the editor.
Related => 17ef6a0
Here is the beta version to test: uBlock0_1.16.4.28b1.firefox-legacy.xpi.zip (rename to xpi to install). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Code is almost original, only changes made by me are on 92f7e4d.