mirror of
https://github.com/TrianguloY/LightningLauncher.git
synced 2024-12-27 09:58:48 +01:00
Fix crash when searching from end of file.
This commit is contained in:
parent
4b0d443d10
commit
5b715fc6b4
1 changed files with 3 additions and 2 deletions
|
@ -75,8 +75,9 @@ public class Search {
|
||||||
Matcher matcher = pattern.matcher(text);
|
Matcher matcher = pattern.matcher(text);
|
||||||
if(!mChkBackwards.isChecked()) {
|
if(!mChkBackwards.isChecked()) {
|
||||||
// search fordwards
|
// search fordwards
|
||||||
|
int from = mEditText.getSelectionStart();
|
||||||
if( matcher.find(mEditText.getSelectionStart() + 1) || matcher.find(0)){
|
if (from != mEditText.getSelectionEnd()) from++; // avoids returning the current selection
|
||||||
|
if( matcher.find(from) || matcher.find(0)){
|
||||||
// found one just after the selection or from the beginning
|
// found one just after the selection or from the beginning
|
||||||
start = matcher.start();
|
start = matcher.start();
|
||||||
end = matcher.end();
|
end = matcher.end();
|
||||||
|
|
Loading…
Reference in a new issue