Appends new comment line to block

@param string $line         Lines to append
@param bool   $newline      True to append extra line at the end
@param int    $indentOffset Ident offset

@return CommentStringBuffer
505853
public function append($line, $newline = true, $indentOffset = 0)
    {
        $line = trim($line);
        if (strlen($line) > 0) {
            parent::append(
                self::COMMENT_LINE_PREFIX . ' ' . $line, $newline, $indentOffset
            );
        } else {
            parent::append(
                self::COMMENT_LINE_PREFIX, $newline, $indentOffset
            );
        }
        return $this;
    }
1239041
public function setIndent($indent) {
    $lines = explode("\n", $this->text);
    if (count($lines) === 1) {
      return $this;
    }
    $comment = '';
    $last_index = count($lines) - 1;
    foreach ($lines as $i => $line) {
      if ($i === 0) {
        $comment .= trim($line) . "\n";
      }
      elseif ($i === $last_index) {
        $comment .= $indent . ' ' . trim($line);
      }
      else {
        $comment .= $indent . ' ' . trim($line) . "\n";
      }
    }
    $this->setText($comment);
    return $this;
  }
824694
public function addCommentAbove($comment) {
    if ($comment instanceof LineCommentBlockNode) {
      $this->before($comment);
    }
    elseif (is_string($comment)) {
      $this->addCommentAbove(LineCommentBlockNode::create($comment));
    }
    else {
      throw new \InvalidArgumentException();
    }
    return $this;
  }
735609
function(offset, newline){
    offset = offset || 0;
    newline = newline ? '\n' : '';
    this.buffer(newline + Array(this.indents + offset).join(this.pp));
    if (this.parentIndents)
      this.buf.push('pug_html = pug_html + pug_indent.join("");');
  }
838797
public MarkdownDocStream indent(int newindent) {
    if(newindent < indent) {
      newline = newline == Newline.BREAK ? Newline.NEWLINE : Newline.PAR;
    }
    indent = newindent;
    return this;
  }
1270048
private static void emitFinishCommentIndentN(PrintWriter fp, int indent) {
		final String spaces = "                                                                   ";
		synchronized (lock) {
			String comment = spaces.substring(0, indent) + " */";
			fp.println(comment);
		}
	}
834891
public function addLine(string $line): Source
    {
        if (strpos($line, "\n") !== false) {
            throw new MultilineException(
                "New line character is forbidden in addLine method argument"
            );
        }

        $this->lines[] = $line;

        return $this;
    }
624869
protected function indent($offset = 0)
    {

        return $this->isPretty()
            ? str_repeat($this->options['indent_style'], ($this->level + $offset) * $this->options['indent_width'])
            : '';
    }
1029632
def comment(node, indent)
      buffer_freeze "\n" if node[@options][:newline]
      if @settings[:pretty]
        if @in_definition
          buffer "' ' * (indent + #{indent})"
        else
          buffer_freeze " " * indent
        end
      end
      buffer_freeze '<!-- '
      buffer_split_by_interpolation node[@value].strip, false
      buffer_freeze ' -->'
      buffer_freeze "\n" if @settings[:pretty]
    end
193820
def newline_text(self, text, indent = False):
        """"""
        self.newline(indent)
        self.text(text)
16430
private void appendLine(final String timeStampStr, final int indentLevel, final String line,
            final StringBuilder buf) {
        buf.append(timeStampStr);
        buf.append('\t');
        buf.append(ClassGraph.class.getSimpleName());
        buf.append('\t');
        final int numDashes = 2 * (indentLevel - 1);
        for (int i = 0; i < numDashes; i++) {
            buf.append('-');
        }
        if (numDashes > 0) {
            buf.append(' ');
        }
        buf.append(line);
        buf.append('\n');
    }
565096
public function addLine(Line $line)
    {
        $this->lines[] = $line;
        $this->end = $line->getIndex();
    }
229989
function appendLineParagraph( $element, $newParent )
    {
        eZDebugSetting::writeDebug( 'kernel-datatype-ezxmltext', $newParent, 'eZSimplifiedXMLInputParser::appendLineParagraph new parent' );
        $ret = array();
        $parent = $element->parentNode;
        if ( !$parent instanceof DOMElement )
        {
            return $ret;
        }

        $parentName = $parent->nodeName;
        $newParentName = $newParent != null ? $newParent->nodeName : '';

        // Correct structure by adding <line> and <paragraph> tags.
        if ( $parentName == 'line' || $this->XMLSchema->isInline( $parent ) )
        {
            return $ret;
        }

        if ( $newParentName == 'line' )
        {
            $element = $parent->removeChild( $element );
            $newParent->appendChild( $element );
            $newLine = $newParent;
            $ret['result'] = $newParent;
        }
        else if (
            $parentName === 'header'
            && (
                $parent->getElementsByTagName( 'line' )->length
                || $parent->getElementsByTagName( 'br' )->length
            )
        )
        {
            // by default the header element does not need a line element
            // unless it contains a <br> or a previously created <line>
            $newLine = $this->createAndPublishElement( 'line', $ret );
            $element = $parent->replaceChild( $newLine, $element );
            $newLine->appendChild( $element );
            $ret['result'] = $newLine;
        }
        elseif ( $parentName == 'paragraph' )
        {
            $newLine = $this->createAndPublishElement( 'line', $ret );
            $element = $parent->replaceChild( $newLine, $element );
            $newLine->appendChild( $element );
            $ret['result'] = $newLine;
        }
        elseif ( $newParentName == 'paragraph' )
        {
            $newLine = $this->createAndPublishElement( 'line', $ret );
            $element = $parent->removeChild( $element );
            $newParent->appendChild( $newLine );
            $newLine->appendChild( $element );
            $ret['result'] = $newLine;
        }
        elseif ( $this->XMLSchema->check( $parent, 'paragraph' ) )
        {
            $newLine = $this->createAndPublishElement( 'line', $ret );
            $newPara = $this->createAndPublishElement( 'paragraph', $ret );
            $element = $parent->replaceChild( $newPara, $element );
            $newPara->appendChild( $newLine );
            $newLine->appendChild( $element );
            $ret['result'] = $newLine;
        }

        return $ret;
    }
726674
function _newLine()
    {
        //if ($this->y < $this->max_y) {
        //    $this->y++;
        //}

        while ($this->y >= $this->max_y) {
            $this->history = array_merge($this->history, array(array_shift($this->screen)));
            $this->screen[] = '';

            $this->history_attrs = array_merge($this->history_attrs, array(array_shift($this->attrs)));
            $this->attrs[] = $this->attr_row;

            if (count($this->history) >= $this->max_history) {
                array_shift($this->history);
                array_shift($this->history_attrs);
            }

            $this->y--;
        }
        $this->y++;
    }
838981
public JBBPDslBuilder NewLineComment(final String text) {
    this.addItem(new ItemComment(text == null ? "" : text, true));
    return this;
  }
570404
public function getBuffer($atOffset = true)
    {
        if ($atOffset === false) {
            return $this->buffer;
        }

        $string = \substr($this->buffer, $this->offset);

        return (string) $string;
    }
1319395
public void setLineSeparator(String newline) {

    if (!LINE_SEPARATOR_CRLF.equals(newline) && !LINE_SEPARATOR_LF.equals(newline) && !LINE_SEPARATOR_LFCR.equals(newline)
        && !LINE_SEPARATOR_CR.equals(newline)) {
      throw new IllegalArgumentException(newline);
    }
    this.lineSeparator = newline;
  }