From: NeilBrown Date: Sun, 20 Aug 2023 04:40:45 +0000 (+1000) Subject: lib-renderline: allow word-wrap setting via attributes. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=3357fc5a8fb400a1b33dda3a4cc1b42d1cfa7021;p=edlib.git lib-renderline: allow word-wrap setting via attributes. Word-wrap is normally enabled for the whole pane. But making it possible for individual lines might be useful, and certainly eases testing. Signed-off-by: NeilBrown --- diff --git a/lib-renderline.c b/lib-renderline.c index 02543f05..7bad5e8a 100644 --- a/lib-renderline.c +++ b/lib-renderline.c @@ -286,6 +286,11 @@ static void parse_line(struct rline_data *rd safe) aupdate(&rd->wrap_tail, v); } else if (aprefix(a, "wrap-")) { aappend(&wrapattr, a+5); + } else if (amatch(a, "word-wrap")) { + if (!v || *v == '1') + rd->word_wrap = 1; + else if (*v == '0') + rd->word_wrap = 0; } else if (amatch(a, "hide")) { hide = ++hide_num; hide_depth = old_len; diff --git a/tests.d/D-test-markup b/tests.d/D-test-markup index 417534ef..d199ca4e 100644 --- a/tests.d/D-test-markup +++ b/tests.d/D-test-markup @@ -1,2 +1,4 @@ This is my test file for markup -Now is the time for all good men to come to the aid of the party +Now is the time for all good men to come to the aid of the party + +Now is the time for all good men to come to the aid of the party