[gimp] app: fix broken debug output on gitlab.



commit d4ff50473553c5ff0c520a37df6ed036ab7688c4
Author: Jehan <jehan girinstud io>
Date:   Mon May 28 06:17:01 2018 +0200

    app: fix broken debug output on gitlab.
    
    The GIMP version string and the backtrace both look completely wrong
    when pasted as-is on gitlab. Somehow all linefeed are gone.
    
    This can be fixed by surrounding these as blocks (triple backticks),
    using markdown syntax. Of course now the debug content is not for our
    tracker only since packagers are encouraged to replace with their own
    tracker URL, but this small markdown syntax is simple enough that it
    should not break formatting on other platforms (as far as I know).

 app/widgets/gimpcriticaldialog.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/app/widgets/gimpcriticaldialog.c b/app/widgets/gimpcriticaldialog.c
index 1ae74b6ba3..1cfba9e32a 100644
--- a/app/widgets/gimpcriticaldialog.c
+++ b/app/widgets/gimpcriticaldialog.c
@@ -175,8 +175,10 @@ gimp_critical_dialog_init (GimpCriticalDialog *dialog)
 
   buffer = gtk_text_buffer_new (NULL);
   version = gimp_version (TRUE, FALSE);
-  gtk_text_buffer_set_text (buffer, version, -1);
+  text = g_strdup_printf ("```\n%s\n```", version);
+  gtk_text_buffer_set_text (buffer, text, -1);
   g_free (version);
+  g_free (text);
 
   dialog->details = gtk_text_view_new_with_buffer (buffer);
   g_object_unref (buffer);
@@ -472,7 +474,7 @@ gimp_critical_dialog_add (GtkWidget   *dialog,
   buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (critical->details));
   gtk_text_buffer_get_iter_at_offset (buffer, &end, -1);
   if (trace)
-    text = g_strdup_printf ("\n> %s\n\nStack trace:\n%s", message, trace);
+    text = g_strdup_printf ("\n> %s\n\nStack trace:\n```\n%s\n```", message, trace);
   else
     text = g_strdup_printf ("\n> %s\n", message);
   gtk_text_buffer_insert (buffer, &end, text, -1);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]