Edje entry: Implement Ctrl+Backspace - delete to start of word.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 14 Dec 2011 16:27:40 +0000 (16:27 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 14 Dec 2011 16:27:40 +0000 (16:27 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@66203 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/edje_entry.c

index 2ce4048..17f2484 100644 (file)
@@ -1192,9 +1192,17 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v
      }
    else if (!strcmp(ev->key, "BackSpace"))
      {
-        if (control)
+        if (control && !en->have_selection)
           {
              // del to start of previous word
+             _sel_start(en->cursor, rp->object, en);
+
+             evas_textblock_cursor_char_prev(en->cursor);
+             evas_textblock_cursor_word_start(en->cursor);
+
+             _sel_extend(en->cursor, rp->object, en);
+
+             _range_del_emit(ed, en->cursor, rp->object, en);
           }
         else if ((alt) && (shift))
           {