billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=19ffa91f1593aabd08c367d4cc15a81170694a9b

commit 19ffa91f1593aabd08c367d4cc15a81170694a9b
Author: Boris Faure <bill...@gmail.com>
Date:   Sun May 3 15:56:48 2020 +0200

    termptyext: add operator to test whether selection is active
---
 src/bin/termptyext.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/bin/termptyext.c b/src/bin/termptyext.c
index 5dc78f1..e6d1e2d 100644
--- a/src/bin/termptyext.c
+++ b/src/bin/termptyext.c
@@ -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);

-- 


Reply via email to