From 0d43d81ee04ea456edb3159aa0e0c71e2f869f62 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 14 May 2009 12:00:51 +0100 Subject: [PATCH] [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. --- clutter/clutter-text.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c index b9b5428ee..5b0aa1422 100644 --- a/clutter/clutter-text.c +++ b/clutter/clutter-text.c @@ -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); } }