MCPcopy Index your code
hub / github.com/antlr/codebuff / indent

Method indent

output/java8/1.4.17/AutoIndentWriter.java:218–239  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

216 }
217
218 public int indent() throws IOException {
219 int n = 0;
220 for (String ind : indents) {
221 if ( ind!=null ) {
222 n += ind.length();
223 out.write(ind);
224 }
225 }
226
227 // If current anchor is beyond current indent width, indent to anchor
228 // *after* doing indents (might tabs in there or whatever)
229
230 int indentWidth = n;
231 if ( anchors_sp>=0 && anchors[anchors_sp]> indentWidth ) {
232 int remainder = anchors[anchors_sp]-indentWidth;
233 for (int i = 1; i<= remainder; i++) out.write(' ');
234 n += remainder;
235 }
236 charPosition += n;
237 charIndex += n;
238 return n;
239 }
240}

Callers 2

writeMethod · 0.95
writeWrapMethod · 0.95

Calls 2

writeMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected