entry: Don't merge undo commands with different cursors

If the user moves the cursor between undo commands, don't merge them.
This is what other implementations do, so mirror them.
This commit is contained in:
Benjamin Otte
2015-08-16 07:32:27 +02:00
parent 131583f54b
commit 0ce285d7f1

View File

@@ -134,7 +134,9 @@ gtk_entry_undo_command_merge (GtkUndoCommand *command,
if (command_priv->entry != followup_priv->entry)
return NULL;
if (!g_str_equal (command_priv->after.text, followup_priv->before.text))
if (!g_str_equal (command_priv->after.text, followup_priv->before.text) ||
command_priv->after.cursor != followup_priv->before.cursor ||
command_priv->after.selection_start != followup_priv->before.selection_start)
return NULL;
/* We don't insist on cursor positions being equal here, someone