| 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 | } |