'everything' keep right input position on backspace

- set context for calc items (usually one one wants to copy its text items instead of googling it)


SVN revision: 48302
This commit is contained in:
Hannes Janetzek 2010-04-25 12:01:20 +00:00
parent da5a495734
commit bf72bd5171
2 changed files with 8 additions and 1 deletions

View 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);

View 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);