-
Notifications
You must be signed in to change notification settings - Fork 432
Add standard text find and replace #2559
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
Open
guanglinn
wants to merge
38
commits into
gsantner:master
Choose a base branch
from
guanglinn:search_improvement
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
63e1bad
add support for normal text find and replace
guanglinn f8afc54
improve find in selection
guanglinn f6edfe6
jump nearby occurrence after finding
guanglinn f3b77fa
fix automatically scroll to the top after finding
guanglinn 15f9aed
clear results after closing
guanglinn 1863367
scroll text view if occurrence is not visible
guanglinn b485182
add temporary test code
guanglinn 708a803
fix occurrence highlight failure affected by input filter
guanglinn 30c0ea7
improve first time visible position setting
guanglinn d30103a
fix link continuously be smaller while searching
guanglinn e9dee6d
improve search fragment colors
guanglinn f9255cd
improve next & previous actions
guanglinn db1a142
minor improvements
guanglinn 241f34f
minor improvements for line numbers
guanglinn 508abc0
Merge branch 'master' into search_improvement
guanglinn e6d6185
improve foreground color of icons for dark theme
guanglinn b00ef28
add delay to find on search text changed
guanglinn ebbab81
Merge branch 'master' into search_improvement
gsantner 6671283
Merge branch 'master' into search_improvement
gsantner b1dbb28
Merge branch 'master' into search_improvement
gsantner fda4f77
Merge branch 'master' into search_improvement
gsantner ac588c7
Merge branch 'master' into search_improvement
gsantner d1211b1
Merge branch 'master' into search_improvement
guanglinn 1f5e29d
revert default font size to 16
guanglinn e44e836
tweaks for showSelection method
guanglinn ebe0463
revert changes for createSmallBlueLinkSpans method
guanglinn 29de41c
use Markor's highlight API for search and replace
guanglinn 52db389
Merge branch 'master' into search_improvement
guanglinn 950a004
Merge branch 'search_improvement' of https://github.com/guanglinn/mar…
guanglinn 30d504c
revert some code
guanglinn a0caac3
Merge branch 'master' into search_improvement
gsantner 563ba00
Merge branch 'master' into search_improvement
guanglinn 6a4af8a
Merge branch 'master' into search_improvement
guanglinn 71b0791
Merge branch 'master' into search_improvement
guanglinn 99c447c
.
guanglinn 7c7a3e5
Merge branch 'master' into search_improvement
gsantner bb5d609
Merge branch 'master' into search_improvement
guanglinn ea63e91
Tweaks
guanglinn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
58 changes: 58 additions & 0 deletions
58
app/src/main/java/net/gsantner/markor/frontend/search/Occurrence.java
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| package net.gsantner.markor.frontend.search; | ||
|
|
||
| public class Occurrence { | ||
guanglinn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| public static final int BACKGROUND_COLOR = 0x90FF0000; | ||
| public static final int SPECIAL_BACKGROUND_COLOR = 0x90FFA500; | ||
| private BackgroundColorSpan backgroundColorSpan; | ||
|
|
||
| private int startIndex; | ||
| private int endIndex; | ||
|
|
||
| public BackgroundColorSpan createBackgroundColorSpan() { | ||
| this.backgroundColorSpan = new BackgroundColorSpan(BACKGROUND_COLOR); | ||
| return this.backgroundColorSpan; | ||
| } | ||
|
|
||
| public BackgroundColorSpan createSpecialBackgroundColorSpan() { | ||
guanglinn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| this.backgroundColorSpan = new BackgroundColorSpan(SPECIAL_BACKGROUND_COLOR); | ||
| return this.backgroundColorSpan; | ||
| } | ||
|
|
||
| public BackgroundColorSpan getBackgroundColorSpan() { | ||
| return this.backgroundColorSpan; | ||
| } | ||
|
|
||
| public static class BackgroundColorSpan extends android.text.style.BackgroundColorSpan { | ||
| public BackgroundColorSpan(int color) { | ||
| super(color); | ||
| } | ||
| } | ||
|
|
||
| public int getStartIndex() { | ||
| return startIndex; | ||
| } | ||
|
|
||
| public int getEndIndex() { | ||
| return endIndex; | ||
| } | ||
|
|
||
| public int getLength() { | ||
| return this.endIndex - this.startIndex; | ||
| } | ||
|
|
||
| public void setStartIndex(int startIndex) { | ||
| this.startIndex = startIndex; | ||
| } | ||
|
|
||
| public void setEndIndex(int endIndex) { | ||
| this.endIndex = endIndex; | ||
| } | ||
|
|
||
| public void offsetStartIndex(int offset) { | ||
| this.startIndex += offset; | ||
| } | ||
|
|
||
| public void offsetEndIndex(int offset) { | ||
| this.endIndex += offset; | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.