MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / get_underlined_words

Method get_underlined_words

test/MockEditorInterface.cpp:529–548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

527}
528
529std::vector<std::string>
530MockEditorInterface::get_underlined_words(
531 int indicator_id) const {
532 auto doc = active_document();
533 if (!doc)
534 return {};
535 if (indicator_id >= static_cast<int>(doc->indicator_info.size()))
536 return {};
537 auto &target = doc->indicator_info[indicator_id].set_for;
538 auto it = target.begin(), jt = target.begin();
539 std::vector<std::string> result;
540 while (true) {
541 it = std::find(jt, target.end(), true);
542 if (it == target.end())
543 return result;
544 jt = std::find(it, target.end(), false);
545 result.push_back(get_text_range(static_cast<TextPosition>(it - target.begin()),
546 static_cast<TextPosition>(jt - target.begin())));
547 }
548}
549
550void MockEditorInterface::make_all_visible() {
551 auto doc = active_document();

Callers 3

EncodingTests.cppFile · 0.80

Calls 4

findFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected