-
Notifications
You must be signed in to change notification settings - Fork 453
Add standard text search 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
98
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
98 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 a6dae48
Merge branch 'master' into search_improvement
guanglinn 2815967
Improve display of TextSearchFragment in Activity
guanglinn bfeafc9
Add an option to switch to line based search dialog
guanglinn 9d0e3bc
Rename Occurrence to Match
guanglinn 325dbfc
Minor improvements
guanglinn c782233
Tweaks
guanglinn b8bca23
Improve match highlight
guanglinn ecca6ed
Minor improvements
guanglinn 4248f7d
More efficient replaceAll method
guanglinn 798ee55
Improve highlightMatches method
guanglinn 9919754
Minor improvements
guanglinn 40de53b
Tweak
guanglinn 0e13a8c
Add clear text buttons
guanglinn 7a44144
Add dark mode support
guanglinn b733c4d
Tweak
guanglinn 6ad41f3
Tweak search match color
guanglinn 64d02e6
Tweak button checked color
guanglinn 7e03688
Show search&replace dialog with current search text
guanglinn 7e8ad48
Set hint to search instead of find
guanglinn 84ca16d
Improve match jump
guanglinn cc4166a
Tweak option text
guanglinn 2c6f4b3
Minor improvements
guanglinn 8460349
Tweaks
guanglinn 516966e
Make debounced search
guanglinn dcea8c8
More efficient HeadlineDialog
guanglinn bb64c34
Clean up code
guanglinn 37aef2b
Improve more efficient HeadlineDialog
guanglinn 0169753
Minor improvements
guanglinn 4ddb1a9
reformat code
gsantner aa655db
Merge branch 'master' into search_improvement
guanglinn 57b78a8
Fix conflicts
guanglinn 710c95b
Support typing Enter to find next occurrence
guanglinn 128b526
Tweak text
guanglinn a9ec17b
Handle PatternSyntaxException
guanglinn e63d4f1
Improve the way of determining active match index
guanglinn 73ae318
Fix Toolbar subtitleTextColor
guanglinn 1c9f717
Support typing new line
guanglinn 72c3057
Minor improvements
guanglinn 4e21555
Handle screen rotation for TextSearchFragment
guanglinn c59bfe5
Tweak layout margins for TextSearchFragment
guanglinn 55356b6
Support setting selection when jumping to the match
guanglinn 1df31f3
Minor improvements
guanglinn 811008e
arrow updown
gsantner 02cafb9
regex
gsantner deb016c
matchcase
gsantner e891c8d
word
gsantner 0e7e626
filter
gsantner 9178f0e
clos
gsantner f3ab70e
arrows
gsantner 73fe25a
revert word change, keep existing translations
gsantner 1b1e389
revert unrelated change
gsantner 3d86794
remove commented text
gsantner bd48a60
.
gsantner 0a15e64
Fix known issues
guanglinn aaa1cf6
Adjust icon tint for dark mode
guanglinn 775c4ea
Minor improvements
guanglinn da8ee22
Improve SearchView UI in view-mode
guanglinn 3f05327
Tweaks
guanglinn 5a99069
Minor improvements for CSS_INLINE_CODE
guanglinn a29d6e0
Minor improvements for left padding of line numbers in view-mode
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.