[text] Maintain the cursor at the end when deleting

If the cursor is already at the end of the Text contents then we
need to maintain its position when deleting the previous character
using the relative key binding.
This commit is contained in:
Emmanuele Bassi 2009-05-14 12:00:51 +01:00
parent 8174f66cc6
commit 0d43d81ee0

View File

@ -1765,17 +1765,17 @@ clutter_text_real_del_prev (ClutterText *self,
{
if (pos == -1)
{
clutter_text_set_cursor_position (self, len - 1);
clutter_text_set_selection_bound (self, len - 1);
clutter_text_delete_text (self, len - 1, len);
clutter_text_set_cursor_position (self, -1);
clutter_text_set_selection_bound (self, -1);
}
else
{
clutter_text_delete_text (self, pos - 1, pos);
clutter_text_set_cursor_position (self, pos - 1);
clutter_text_set_selection_bound (self, pos - 1);
clutter_text_delete_text (self, pos - 1, pos);
}
}