private int findSpanStart ( TextCursor cursor , int limit ) { for ( int i = cursor . currentOffset ; i < limit ; i ++ ) { char c = cursor . text . charAt ( i ) ; if ( c == ' ' || c == ' ' ) { // Check prev and next symbols if ( isGoodAnchor ( cursor . text , i - 1 ) && isNotSymbol ( cursor . text , i + 1 , c ) ) { return i ; } } } return - 1 ; }
Searching for valid formatting span start