This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
[python] fix wrapping
- From: Tom Tromey <tromey at redhat dot com>
- To: Project Archer <archer at sourceware dot org>
- Date: Mon, 15 Dec 2008 10:53:50 -0700
- Subject: [python] fix wrapping
- Reply-to: Tom Tromey <tromey at redhat dot com>
This fixes a minor bug when word-wrapping.
We want to wrap after a comma, not before one.
Tom
2008-12-15 Tom Tromey <tromey@redhat.com>
* python/python.c (print_children): Wrap after ",".
diff --git a/gdb/python/python.c b/gdb/python/python.c
index e7c3d7a..9a1d321 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1092,10 +1092,15 @@ print_children (PyObject *printer, const char *hint,
else if (! is_map || i % 2 == 0)
fputs_filtered (pretty ? "," : ", ", stream);
- if (pretty && (! is_map || i % 2 == 0))
+ if (! is_map || i % 2 == 0)
{
- fputs_filtered ("\n", stream);
- print_spaces_filtered (2 + 2 * recurse, stream);
+ if (pretty)
+ {
+ fputs_filtered ("\n", stream);
+ print_spaces_filtered (2 + 2 * recurse, stream);
+ }
+ else
+ wrap_here (n_spaces (2 + 2 *recurse));
}
if (is_map && i % 2 == 0)
@@ -1132,8 +1137,6 @@ print_children (PyObject *printer, const char *hint,
if (is_map && i % 2 == 0)
fputs_filtered ("] = ", stream);
- else if (! pretty)
- wrap_here (n_spaces (2 + 2 * recurse));
do_cleanups (inner_cleanup);
}