| 480 | } |
| 481 | |
| 482 | static void clear_current_line(const std::vector<int> & widths) { |
| 483 | int total_width = 0; |
| 484 | for (int w : widths) { |
| 485 | total_width += (w > 0 ? w : 1); |
| 486 | } |
| 487 | |
| 488 | if (total_width > 0) { |
| 489 | std::string spaces(total_width, ' '); |
| 490 | fwrite(spaces.c_str(), 1, total_width, out); |
| 491 | move_cursor(-total_width); |
| 492 | } |
| 493 | } |
| 494 | |
| 495 | static void set_line_contents(std::string new_line, std::string & line, std::vector<int> & widths, size_t & char_pos, |
| 496 | size_t & byte_pos) { |
no test coverage detected