billiob pushed a commit to branch terminology-1.6.

http://git.enlightenment.org/apps/terminology.git/commit/?id=2a3a34f5038eabc0e4d7ef9b80ba5f5f94693958

commit 2a3a34f5038eabc0e4d7ef9b80ba5f5f94693958
Author: Boris Faure <[email protected]>
Date:   Sun Feb 16 18:51:36 2020 +0100

    termptyesc: handle zero-width spaces, with test
---
 src/bin/termptyops.c       |  4 ++--
 tests/tests.results        |  5 +++++
 tests/zero-width-spaces.sh | 15 +++++++++++++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c
index 27c4399..2ea8fc9 100644
--- a/src/bin/termptyops.c
+++ b/src/bin/termptyops.c
@@ -206,8 +206,8 @@ termpty_text_append(Termpty *ty, const Eina_Unicode 
*codepoints, int len)
           }
 
         g = _termpty_charset_trans(ty, codepoints[i]);
-        /* Skip 0-width space */
-        if (EINA_UNLIKELY(g == 0x200b))
+        /* Skip 0-width space or RTL/LTR marks */
+        if (EINA_UNLIKELY(g >= 0x200b && g <= 0x200f))
           {
              continue;
           }
diff --git a/tests/tests.results b/tests/tests.results
index 356b5ad..a5e408f 100644
--- a/tests/tests.results
+++ b/tests/tests.results
@@ -122,3 +122,8 @@ osc-11-query.sh b762d503e40641ff896dac46391ad7a8
 link_detection.sh bbe87a849586e8b922f26ad5d88146dc
 selection_with_tabs.sh 23557497a8f28ca246048bb2443b3dab
 selection_empty_lines.sh 7a90d9bfde9e9fb7f067f6c08eac57ff
+osc-invalid.sh 0acecbe16bb3b257745787c40affdb90
+title_icon_stack_simple.sh 9231de4459dbb52d0ffab6f33fc386a0
+title_icon_stack_unset.sh d2ebe2295eb036d9612209490f8aa7f9
+title_icon_stack_default.sh d2ebe2295eb036d9612209490f8aa7f9
+zero-width-spaces.sh 4bbf6bbaef5f651d27b7593d82650de9
diff --git a/tests/zero-width-spaces.sh b/tests/zero-width-spaces.sh
new file mode 100755
index 0000000..0ff4cf4
--- /dev/null
+++ b/tests/zero-width-spaces.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# fill space with E
+printf '\033#8'
+#set color
+printf '\033[46;31;3m'
+
+# Zero width space
+printf 'aa\xe2\x80\x8baa\n'
+
+# Zero width space non-joiner
+printf 'aa\xe2\x80\x8caa\n'
+
+# Zero width space joiner
+printf 'aa\xe2\x80\x8daa\n'

-- 


Reply via email to