From 904b3cf62e1f6201fa70aa22d23be89143342976 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sun, 10 Feb 2019 23:56:30 +0100 Subject: [PATCH] termptyext: use real selection to test And not just compare with the codepoint array that may not have \n and too many spaces --- src/bin/termptyext.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/bin/termptyext.c b/src/bin/termptyext.c index d3b04fb8..fba13f34 100644 --- a/src/bin/termptyext.c +++ b/src/bin/termptyext.c @@ -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++; } }