Revert "text: Make editable API irreversible"

This reverts commit 08479ae4b2.
This commit is contained in:
Mat 2023-03-01 14:03:49 +02:00
parent d0e3dc7ce0
commit ea1bb79566

View File

@ -3388,15 +3388,11 @@ gtk_text_insert_text (GtkText *self,
* The incoming text may a password or other secret. We make sure
* not to copy it into temporary buffers.
*/
if (priv->change_count == 0)
gtk_text_history_begin_irreversible_action (priv->history);
begin_change (self);
n_inserted = gtk_entry_buffer_insert_text (get_buffer (self), *position, text, n_chars);
end_change (self);
if (priv->change_count == 0)
gtk_text_history_end_irreversible_action (priv->history);
if (n_inserted != n_chars)
gtk_widget_error_bell (GTK_WIDGET (self));
@ -3418,16 +3414,11 @@ gtk_text_delete_text (GtkText *self,
if (start_pos == end_pos)
return;
if (priv->change_count == 0)
gtk_text_history_begin_irreversible_action (priv->history);
begin_change (self);
gtk_entry_buffer_delete_text (get_buffer (self), start_pos, end_pos - start_pos);
end_change (self);
if (priv->change_count == 0)
gtk_text_history_end_irreversible_action (priv->history);
update_placeholder_visibility (self);
if (priv->propagate_text_width)
gtk_widget_queue_resize (GTK_WIDGET (self));