code: private static int emitLine( StringBuilder target, char[] buffer, int start, int end, int indentation )
      {
          int last = start;
          for ( int pos = start, cp; pos < end; pos += charCount( cp ) )
          {
              cp = codePointAt( buffer, pos );
              if ( cp == '\n' )
              {
                  end = pos + 1;
              }
              if ( indentation > 0 )
              {
                  if ( --indentation == 0 )
                  {
                      start = pos + 1;
                  }
                  last = pos;
              }
              else if ( !isWhitespace( cp ) )
              {
                  last = pos + 1;
              }
          }
          target.append( buffer, start, last - start );
          return end;
      }
docs: Emits the line that starts at {@code start} position, and ends at a newline or the {@code end} position.
  
  @return the start position of the next line (the {@code end} position