Detect breaks on write_string_to_grid

memfd
Manos Pitsidianakis 2020-02-28 09:17:30 +02:00
parent f10cc954e7
commit 63af2a688a
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 10 additions and 0 deletions

View File

@ -1710,6 +1710,16 @@ pub fn write_string_to_grid(
if c == '\r' {
continue;
}
if c == '\n' {
y += 1;
if line_break.is_none() {
break;
} else {
x = line_break.unwrap();
inspect_bounds!(grid, area, x, y, line_break);
continue;
}
}
if c == '\t' {
grid[(x, y)].set_ch(' ');
x += 1;