--- a/src/TabularPrefetchingHandler.h Sun Nov 17 17:51:13 2019 +0100
+++ b/src/TabularPrefetchingHandler.h Fri Nov 29 22:34:57 2019 +0100
@@ -80,6 +80,7 @@
result << convertor.from_bytes(color);
for (auto & ch : value) {
+ // see computeWidth below
switch (ch) {
case L'\n': result << colorizeReplacement(L"↲", color);
break;
@@ -104,7 +105,19 @@
*/
integer_t computeWidth(const string_t& stringValue) {
integer_t width = 0;
- for (wchar_t ch : stringValue) width += std::max(0, wcwidth(ch));
+ for (wchar_t ch : stringValue) {
+ // see formatValue() above
+ switch (ch) {
+ case L'\n':
+ case L'\r':
+ case L'\t':
+ case L' ':
+ width += 1;
+ break;
+ default:
+ width += std::max(0, wcwidth(ch));
+ }
+ }
return width;
}