@NotNull private static TextRange processSpaces(@NotNull Helper helper,@NotNull TextRange range,int tabWidth){
  CharSequence indent=helper.getCurrentLineIndent();
  int start=Math.max(0,range.getStartOffset() - helper.getCurrentLineStartOffset());
  int end=Math.min(indent.length(),range.getEndOffset() - helper.getCurrentLineStartOffset());
  int tabsNumber=0;
  int indentOffset=end;
  for (int i=start; i < end; i++) {
    char c=indent.charAt(i);
    if (c == '\t') {
      tabsNumber++;
    }
 else     if (c != ' ') {
      indentOffset=i;
      break;
    }
  }
  if (tabsNumber > 0) {
    helper.replace(start,indentOffset,StringUtil.repeat(" ",indentOffset - start - tabsNumber + tabsNumber * tabWidth));
    return TextRange.create(range.getStartOffset(),range.getEndOffset() - tabsNumber + tabsNumber * tabWidth);
  }
 else {
    return range;
  }
}

@ NotNull private static TextRange processSpaces ( @ NotNull Helper helper , @ NotNull TextRange range , int tabWidth ) { CharSequence indent = helper . getCurrentLineIndent ( ) ; int start = Math . max ( 0 , range . getStartOffset ( ) - helper . getCurrentLineStartOffset ( ) ) ; int end = Math . min ( indent . length ( ) , range . getEndOffset ( ) - helper . getCurrentLineStartOffset ( ) ) ; int tabsNumber = 0 ; int indentOffset = end ; for ( int i = start ; i < end ; i ++ ) { char c = indent . charAt ( i ) ; if ( c == '\t' ) { tabsNumber ++ ; } else if ( c != ' ' ) { indentOffset = i ; break ; } } if ( tabsNumber > 0 ) { helper . replace ( start , indentOffset , StringUtil . repeat ( " " , indentOffset - start - tabsNumber + tabsNumber * tabWidth ) ) ; return TextRange . create ( range . getStartOffset ( ) , range . getEndOffset ( ) - tabsNumber + tabsNumber * tabWidth ) ; } else { return range ; } }
converts tabulations to white spaces at the target line ' s indent space .
