ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/tools/edi.git/commit/?id=20655d2bf9705e917a273ddbe9c2b59f884cd250

commit 20655d2bf9705e917a273ddbe9c2b59f884cd250
Author: Andy Williams <[email protected]>
Date:   Sat Nov 29 20:13:18 2014 +0000

    Fix bug with undo not operating on current tab - fixes issue T1853.
    
     Seems like a weird bug in the smart callbacks as they would pass the wrong 
event data in!
---
 src/bin/editor/edi_editor.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/bin/editor/edi_editor.c b/src/bin/editor/edi_editor.c
index 2c756f9..cd3602e 100644
--- a/src/bin/editor/edi_editor.c
+++ b/src/bin/editor/edi_editor.c
@@ -140,9 +140,12 @@ _changed_cb(void *data, Evas_Object *obj EINA_UNUSED, void 
*event_info)
 }
 
 static void
-_smart_cb_key_down(void *data, Evas *e EINA_UNUSED,
+_smart_cb_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
                    Evas_Object *obj EINA_UNUSED, void *event)
 {
+   Edi_Mainview_Item *item;
+   Edi_Editor *editor;
+   Evas_Object *content;
    Eina_Bool ctrl, alt, shift;
    Evas_Event_Key_Down *ev = event;
 
@@ -150,6 +153,10 @@ _smart_cb_key_down(void *data, Evas *e EINA_UNUSED,
    alt = evas_key_modifier_is_set(ev->modifiers, "Alt");
    shift = evas_key_modifier_is_set(ev->modifiers, "Shift");
 
+   item = edi_mainview_item_current_get();
+   content = elm_object_item_content_get(item->view);
+   editor = (Edi_Editor *)evas_object_data_get(content, "editor");
+
    if ((!alt) && (ctrl) && (!shift))
      {
         if (!strcmp(ev->key, "Prior"))
@@ -170,7 +177,7 @@ _smart_cb_key_down(void *data, Evas *e EINA_UNUSED,
           }
         else if (!strcmp(ev->key, "z"))
           {
-             _undo_cb(data, obj, event);
+             _undo_cb(editor, obj, event);
           }
      }
 }

-- 


Reply via email to