Fixes issue when first character starts with @

This commit is contained in:
tom79 2017-08-10 09:54:43 +02:00
parent 7738b22760
commit 33a09db9de
1 changed files with 5 additions and 2 deletions

View File

@ -416,8 +416,11 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
if( currentCursorPosition- (searchLength-1) < 0 || currentCursorPosition == 0 || currentCursorPosition > s.toString().length())
return;
Matcher m = sPattern.matcher(s.toString().substring(currentCursorPosition- (searchLength-1), currentCursorPosition));
Matcher m;
if( s.toString().charAt(0) == '@')
m = sPattern.matcher(s.toString().substring(currentCursorPosition- searchLength, currentCursorPosition));
else
m = sPattern.matcher(s.toString().substring(currentCursorPosition- (searchLength-1), currentCursorPosition));
if(m.matches()) {
String search = m.group(3);
if (pp_progress != null && pp_actionBar != null) {