From 39b0cfeefdd530b48b1f3fb827c12c9048131bbe Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Wed, 28 Jul 2021 22:24:29 -0400 Subject: [PATCH] nbsp handling --- terminal.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/terminal.d b/terminal.d index 2913248..f9ad897 100644 --- a/terminal.d +++ b/terminal.d @@ -5322,7 +5322,9 @@ class LineGetter { void addString(string s) { // FIXME: this could be more efficient // but does it matter? these lines aren't super long anyway. But then again a paste could be excessively long (prolly accidental, but still) - foreach(dchar ch; s) + + import std.utf; + foreach(dchar ch; s.byDchar) // using this for the replacement dchar, normal foreach would throw on invalid utf 8 addChar(ch); } @@ -5531,6 +5533,7 @@ class LineGetter { case '\t': specialChar('t'); break; case '\b': specialChar('b'); break; case '\033': specialChar('e'); break; + case '\ ': specialChar(' '); break; default: if(highlightEnd) { if(idx == highlightBegin) {