termptyext: use real selection to test

And not just compare with the codepoint array that may not have \n and too
many spaces
This commit is contained in:
Boris Faure 2019-02-10 23:56:30 +01:00
parent aa9e74d401
commit 904b3cf62e
1 changed files with 10 additions and 5 deletions

View File

@ -221,15 +221,20 @@ static void
_handle_selection_is(Termpty *ty,
const Eina_Unicode *buf)
{
Eina_Unicode *cp = ty->selection.codepoints;
size_t len = 0;
Termio *sd = termio_get_from_obj(ty->obj);
const char *s = termio_internal_get_selection(sd, &len);
assert(ty->selection.is_active);
assert(ty->selection.codepoints != NULL);
assert(s != NULL);
return;
while (*buf)
{
assert(*buf == *cp);
cp++;
int idx;
Eina_Unicode u = eina_unicode_utf8_next_get(s, &idx);
assert(*buf == u);
s += idx;
buf++;
}
}