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