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

Method indent

output/java/1.4.17/AutoIndentWriter.java:222–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 2

writeMethod · 0.95
writeWrapMethod · 0.95

Calls 2

writeMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected