fixed bug where error lines would be 1 character too long

This commit is contained in:
Mark 2023-08-28 01:04:01 +02:00
parent cad3e759af
commit 0991c84de5

View File

@ -468,7 +468,8 @@ impl TuiFile {
text_charlen -= 1; text_charlen -= 1;
} }
text.push_str(" - Err: "); text.push_str(" - Err: ");
text_charlen += 8; // make text_charlen 1 too large (for the endchar)
text_charlen += 9;
for ch in e.chars() { for ch in e.chars() {
if ch == '\n' || ch == '\r' { if ch == '\n' || ch == '\r' {
continue; continue;
@ -479,8 +480,6 @@ impl TuiFile {
text_charlen += 1; text_charlen += 1;
text.push(ch); text.push(ch);
} }
// make text_charlen 1 too large (for the endchar)
text_charlen += 1;
while text_charlen < share.size.0 as _ { while text_charlen < share.size.0 as _ {
text.push(' '); text.push(' ');
text_charlen += 1; text_charlen += 1;