'everything' keep right input position on backspace
authorHannes Janetzek <hannes.janetzek@gmail.com>
Sun, 25 Apr 2010 12:01:20 +0000 (12:01 +0000)
committerHannes Janetzek <hannes.janetzek@gmail.com>
Sun, 25 Apr 2010 12:01:20 +0000 (12:01 +0000)
- set context for calc items (usually one one wants to copy its text items instead of googling it)

SVN revision: 48302

src/modules/everything-calc/e_mod_main.c
src/modules/everything/evry.c

index 1e8b4a2..9421089 100644 (file)
@@ -31,12 +31,14 @@ _begin(Evry_Plugin *p, const Evry_Item *item __UNUSED__)
        EINA_LIST_FREE(history, result)
          {
             it = evry_item_new(NULL, p, result, NULL);
+            it->context = eina_stringshare_ref(p->name); 
             p->items = eina_list_prepend(p->items, it);
             eina_stringshare_del(result);
          }
      }
 
    it = evry_item_new(NULL, p, "0", NULL);
+   it->context = eina_stringshare_ref(p->name); 
    p->items = eina_list_prepend(p->items, it);
 
    return p;
@@ -127,6 +129,7 @@ _action(Evry_Plugin *p, const Evry_Item *it)
    it_old->selected = EINA_FALSE;
    
    it2 = evry_item_new(NULL, p, it_old->label, NULL);
+   it2->context = eina_stringshare_ref(p->name); 
    p->items = eina_list_prepend(p->items, it2);
 
    evry_plugin_async_update(p, EVRY_ASYNC_UPDATE_ADD);
index 8d8f6ef..3e09526 100644 (file)
@@ -1586,7 +1586,11 @@ _evry_backspace(Evry_Selector *sel)
             val = *(s->inp + pos);
 
             s->inp[pos] = 0;
-            s->input = s->inp;
+            
+            if (s->trigger_active && s->inp[0] != 0)
+              s->input = s->inp + 1;
+            else
+              s->input = s->inp;
 
             if ((pos == 0) || !isspace(val))
               _evry_update(sel, 1);