From 606a66dd6d60f46807735e2e98d080f570229e61 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Fri, 10 May 2019 00:45:36 +0200 Subject: text: fix escape sequence disapearing at the end of a line --- util/text/text_test.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'util/text/text_test.go') diff --git a/util/text/text_test.go b/util/text/text_test.go index 9bf21164..5be25409 100644 --- a/util/text/text_test.go +++ b/util/text/text_test.go @@ -307,6 +307,12 @@ func TestExtractApplyTermEscapes(t *testing.T) { "This is an example.", []escapeItem{{"\x1b[31m", 5}, {"\x1b[0m", 10}}, }, + // Escape at the end + { + "This \x1b[31mis an example.\x1b[0m", + "This is an example.", + []escapeItem{{"\x1b[31m", 5}, {"\x1b[0m", 19}}, + }, // A plain wide line with escapes. { "一只敏捷\x1b[31m的狐狸\x1b[0m跳过了一只懒狗。", -- cgit