code: public int getSpanStart(Object what) {
          int count = mSpanCount;
          Object[] spans = mSpans;
  
          for (int i = count - 1; i >= 0; i--) {
              if (spans[i] == what) {
                  int where = mSpanStarts[i];
  
                  if (where > mGapStart)
                      where -= mGapLength;
  
                  return where;
              }
          }
  
          return -1;
      }
docs: Return the buffer offset of the beginning of the specified
  markup object, or -1 if it is not attached to this buffer.