private void handleFormatCodeTag(int startPos, int endPos, boolean isOpeningTag) { if (!this.options.comment_format_source) { handleNoFormatTag(startPos, endPos, isOpeningTag); return; } // add empty lines before opening and after closing token handleSeparateLineTag(startPos, endPos); if (isOpeningTag) { int startIndex = tokenStartingAt(startPos); if (startIndex > 1) this.ctm.get(startIndex).putLineBreaksBefore(2); if (this.formatCodeTagOpenEnd < 0) this.formatCodeTagOpenEnd = endPos; } else if (this.formatCodeTagOpenEnd >= 0) { int endTagIndex = tokenEndingAt(endPos); if (endTagIndex < this.ctm.size() - 2) this.ctm.get(endTagIndex).putLineBreaksAfter(2); formatCode(startPos, endPos); this.formatCodeTagOpenEnd = -1; this.lastFormatCodeClosingTagIndex = this.ctm.findIndex(startPos, -1, true); } }
private void handleFormatCodeTag(int startPos, int endPos, boolean isOpeningTag) { if (!this.options.comment_format_source) { handleNoFormatTag(startPos, endPos, isOpeningTag); return; } // add empty lines before opening and after closing token handleSeparateLineTag(startPos, endPos); if (isOpeningTag) { int startIndex = tokenStartingAt(startPos); if (startIndex > 1) this.ctm.get(startIndex).putLineBreaksBefore(2); if (this.formatCodeTagOpenEnd < 0) this.formatCodeTagOpenEnd = endPos; } else if (this.formatCodeTagOpenEnd >= 0) { int endTagIndex = tokenEndingAt(endPos); if (endTagIndex < this.ctm.size() - 2) this.ctm.get(endTagIndex).putLineBreaksAfter(2); formatCode(startPos, endPos); this.formatCodeTagOpenEnd = -1; this.lastFormatCodeClosingTagIndex = this.ctm.findIndex(startPos, -1, true); } }
private void handleFormatCodeTag(int startPos, int endPos, boolean isOpeningTag) { if (!this.options.comment_format_source) { handleNoFormatTag(startPos, endPos, isOpeningTag); return; } // add empty lines before opening and after closing token handleSeparateLineTag(startPos, endPos); if (isOpeningTag) { int startIndex = tokenStartingAt(startPos); if (startIndex > 1) this.ctm.get(startIndex).putLineBreaksBefore(2); if (this.formatCodeTagOpenEnd < 0) this.formatCodeTagOpenEnd = endPos; } else if (this.formatCodeTagOpenEnd >= 0) { int endTagIndex = tokenEndingAt(endPos); if (endTagIndex < this.ctm.size() - 2) this.ctm.get(endTagIndex).putLineBreaksAfter(2); formatCode(startPos, endPos); this.formatCodeTagOpenEnd = -1; this.lastFormatCodeClosingTagIndex = this.ctm.findIndex(startPos, -1, true); } }