Mercurial > hg > octave-lojdl
changeset 1200:50cc3480a2db
[project @ 1995-03-31 22:35:02 by jwe]
author | jwe |
---|---|
date | Fri, 31 Mar 1995 22:35:02 +0000 |
parents | 4f1bfa351b99 |
children | 97c541091d3b |
files | src/tc-rep.cc |
diffstat | 1 files changed, 16 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/tc-rep.cc +++ b/src/tc-rep.cc @@ -60,6 +60,18 @@ // Indentation level for structures. static int structure_indent_level = 0; +static void +increment_structure_indent_level (void) +{ + structure_indent_level += 2; +} + +static void +decrement_structure_indent_level (void) +{ + structure_indent_level -= 2; +} + static int any_element_is_complex (const ComplexMatrix& a) { @@ -1772,12 +1784,12 @@ unwind_protect_int (structure_indent_level); unwind_protect_int (user_pref.struct_levels_to_print); - structure_indent_level += 2; - if (user_pref.struct_levels_to_print > 0) { user_pref.struct_levels_to_print--; + increment_structure_indent_level (); + for (Pix p = a_map->first (); p != 0; a_map->next (p)) { const char *key = a_map->key (p); @@ -1794,6 +1806,8 @@ val.print (output_buf); } + decrement_structure_indent_level (); + output_buf.form ("%*s%s", structure_indent_level, "", "}\n"); } else