From 0ce285d7f1ec11fa2cd5759769d0f2d4909669ff Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 16 Aug 2015 07:32:27 +0200 Subject: [PATCH] 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. --- gtk/gtkentryundocommand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gtk/gtkentryundocommand.c b/gtk/gtkentryundocommand.c index 6a902ea38d..e7812cf617 100644 --- a/gtk/gtkentryundocommand.c +++ b/gtk/gtkentryundocommand.c @@ -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