| 5111 | } |
| 5112 | |
| 5113 | void calcLength() { |
| 5114 | assert(m_stringIndex < m_column.m_strings.size()); |
| 5115 | |
| 5116 | m_suffix = false; |
| 5117 | auto width = m_column.m_width - indent(); |
| 5118 | m_end = m_pos; |
| 5119 | while (m_end < line().size() && line()[m_end] != '\n') |
| 5120 | ++m_end; |
| 5121 | |
| 5122 | if (m_end < m_pos + width) { |
| 5123 | m_len = m_end - m_pos; |
| 5124 | } else { |
| 5125 | size_t len = width; |
| 5126 | while (len > 0 && !isBoundary(m_pos + len)) |
| 5127 | --len; |
| 5128 | while (len > 0 && isWhitespace(line()[m_pos + len - 1])) |
| 5129 | --len; |
| 5130 | |
| 5131 | if (len > 0) { |
| 5132 | m_len = len; |
| 5133 | } else { |
| 5134 | m_suffix = true; |
| 5135 | m_len = width - 1; |
| 5136 | } |
| 5137 | } |
| 5138 | } |
| 5139 | |
| 5140 | auto indent() const -> size_t { |
| 5141 | auto initial = m_pos == 0 && m_stringIndex == 0 ? m_column.m_initialIndent : std::string::npos; |
nothing calls this directly
no test coverage detected