code: static int fixSelectionLength( String fullText, int selectionOffset, int selectionLength ) {
  
  		if( selectionLength < 0 )
  			selectionLength = 0;
  		else if( selectionOffset + selectionLength > fullText.length())
  			selectionLength = fullText.length() - selectionOffset;
  
  		for( ; selectionOffset + selectionLength < fullText.length(); selectionLength ++ ) {
  			char c = fullText.charAt( selectionOffset + selectionLength );
  			if( isLineBreak( c ))
  				break;
  		}
  
  		return selectionLength;
  	}
docs: Fixes the selection length to get the whole line.
  @param fullText the full text (not null)
  @param selectionOffset a <b>valid</b> selection offset
  @param selectionLength the selection length
  @return a valid selection length (can be zero)