if (par->bidi_props)
evas_bidi_paragraph_props_unref(par->bidi_props);
#endif
- if (par->text_node)
+ /* If we are the active par of the text node, set to NULL */
+ if (par->text_node && (par->text_node->par == par))
par->text_node->par = NULL;
free(par);
}
to->format_node = from->format_node;
}
+ /* When it comes to how we handle it, merging is like removing both nodes
+ * and creating a new one, se we need to do the needed cleanups. */
+ if (to->par)
+ to->par->text_node = NULL;
+ to->par = NULL;
+
+ to->new = EINA_TRUE;
+
_evas_textblock_cursors_set_node(o, from, to);
_evas_textblock_node_text_remove(o, from);
}