aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-03-27 23:28:43 +0200
committerThomas White <taw@physics.org>2018-03-27 23:28:43 +0200
commit80717944576ff3fec50b037480c9dd8295b1b1b3 (patch)
tree3f8cdae3be7ae37c2029de6d75a255cbc16b6847
parent82126f1cc19ca94f4d5596ee22de007b6a999efa (diff)
Avoid creating an empty run when importing an image
-rw-r--r--src/sc_editor.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c
index a870059..7b58c8f 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -1789,8 +1789,9 @@ static void dnd_receive(GtkWidget *widget, GdkDragContext *drag_context,
e->start_corner_y, w, h);
fr->is_image = 1;
fr->empty = 0;
- sc_block_append_inside(fr->scblocks, "image", opts, "");
- full_rerender(e); /* FIXME: No need for full */
+ sc_block_set_name(sc_block_child(fr->scblocks), strdup("image"));
+ sc_block_set_options(sc_block_child(fr->scblocks), opts);
+ full_rerender(e);
sc_editor_remove_cursor(e);
sc_editor_redraw(e);
free(filename);