termptyext: add operator to test whether selection is active

This commit is contained in:
Boris Faure 2020-05-03 15:56:48 +02:00
parent f679d28809
commit 19ffa91f15
Signed by: borisfaure
GPG Key ID: 35C0410516166BE8
1 changed files with 11 additions and 1 deletions

View File

@ -314,6 +314,16 @@ _handle_link(Termpty *ty, const Eina_Unicode *buf)
free(link);
}
static void
_handle_selection_active(Termpty *ty,
const Eina_Unicode *buf)
{
if (*buf == '!')
assert(ty->selection.is_active);
else
assert(!ty->selection.is_active);
}
static void
_handle_selection_is(Termpty *ty,
const Eina_Unicode *buf)
@ -414,7 +424,7 @@ tytest_handle_escape_codes(Termpty *ty,
_handle_mouse_move(ty, buf + 1);
break;
case 'n':
assert(!ty->selection.is_active);
_handle_selection_active(ty, buf + 1);
break;
case 'r':
_handle_force_render(ty);