summaryrefslogtreecommitdiff
path: root/gtksourceview/gtksourcebufferoutputstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtksourceview/gtksourcebufferoutputstream.c')
-rw-r--r--gtksourceview/gtksourcebufferoutputstream.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gtksourceview/gtksourcebufferoutputstream.c b/gtksourceview/gtksourcebufferoutputstream.c
index 44d6f7fa..2756a3c0 100644
--- a/gtksourceview/gtksourcebufferoutputstream.c
+++ b/gtksourceview/gtksourcebufferoutputstream.c
@@ -615,7 +615,17 @@ insert_fallback (GtkSourceBufferOutputStream *stream,
for (gsize i = 0; i < count; i++)
{
guint8 c = ((const guint8 *)buffer)[i];
+
g_string_append_len (str, hex_fallback[c], 3);
+
+ /* Add an occasional newline so that we are more
+ * likely to not tank app performance.
+ */
+ if ((i+1) % 80 == 0)
+ {
+ g_string_append_c (str, '\n');
+ }
+
}
gtk_text_buffer_insert (GTK_TEXT_BUFFER (stream->priv->source_buffer),