text:t Small fixes

gtk_editable_delete_text() takes a half-open interval, and accepts
an end_pos of -1 to mean 'all the way'. The GtkText implementation
was not handling these details correctly.
This commit is contained in:
Matthias Clasen
2024-02-19 14:23:21 -05:00
parent 849e3403cd
commit ca8ba8ce87

View File

@@ -3454,6 +3454,9 @@ gtk_text_delete_text (GtkText *self,
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
if (end_pos < 0)
end_pos = gtk_entry_buffer_get_length (get_buffer (self));
if (start_pos == end_pos)
return;