This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[python] fix wrapping


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]