summaryrefslogtreecommitdiff
path: root/gtk/inspector
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-03-17 21:59:26 +0100
committerBenjamin Otte <otte@redhat.com>2016-04-08 16:18:07 +0200
commit32d671cfd771dee18889bc0b4c482721cdc9ca29 (patch)
treef41d7f27e01132aee3a453b243ebabfbe3bcf348 /gtk/inspector
parentfae4a1417731f01775d98e0384ff1d650000f2e4 (diff)
downloadgtk+-32d671cfd771dee18889bc0b4c482721cdc9ca29.tar.gz
inspector: Move errors on EOF token to last token
That's wrong, but it makes sure we don't lose any error messages.
Diffstat (limited to 'gtk/inspector')
-rw-r--r--gtk/inspector/css-editor.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gtk/inspector/css-editor.c b/gtk/inspector/css-editor.c
index a8ca34f372..3b3210a2f9 100644
--- a/gtk/inspector/css-editor.c
+++ b/gtk/inspector/css-editor.c
@@ -180,15 +180,18 @@ static void
gtk_css_chunk_token_source_error (GtkCssTokenSource *source,
const GError *error)
{
- GtkCssChunkTokenSource *chunk = (GtkCssChunkTokenSource *) source;
+ GtkCssChunkTokenSource *chunk_source = (GtkCssChunkTokenSource *) source;
+ GtkCssChunk *chunk;
- if (chunk->chunk == NULL)
- return;
+ if (chunk_source->chunk != NULL)
+ chunk = chunk_source->chunk;
+ else
+ chunk = gtk_css_rb_tree_get_last (chunk_source->tree);
- if (chunk->chunk->error)
+ if (chunk->error)
g_warning ("figure out what to do with two errors on the same token");
else
- chunk->chunk->error = g_error_copy (error);
+ chunk->error = g_error_copy (error);
}
const GtkCssTokenSourceClass GTK_CSS_CHUNK_TOKEN_SOURCE = {