| 190 | } |
| 191 | |
| 192 | TextPosition SpellChecker::next_token_end_in_document(TextPosition end) const { |
| 193 | TextPosition shift = 15; |
| 194 | auto prev_end = end; |
| 195 | auto length = m_editor.get_active_document_length(); |
| 196 | if (end == length) |
| 197 | return end; |
| 198 | while (end > 0) { |
| 199 | end = std::min(end + shift, length); |
| 200 | auto mapped_str = m_editor.get_mapped_wstring_range(prev_end, end); |
| 201 | // finding any start before start which starts a token |
| 202 | auto index = next_token_end(mapped_str.str, 0); |
| 203 | if (index < static_cast<TextPosition>(mapped_str.str.length())) |
| 204 | return mapped_str.to_original_index(index); |
| 205 | if (end == length) |
| 206 | return end; |
| 207 | prev_end = end; |
| 208 | shift *= 2; |
| 209 | } |
| 210 | return end; |
| 211 | } |
| 212 | |
| 213 | MappedWstring SpellChecker::get_visible_text() { |
| 214 | auto top_visible_line = m_editor.get_first_visible_line(); |
nothing calls this directly
no test coverage detected