MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / updateCacheInfo

Method updateCacheInfo

src/plugins/codeeditor/gui/private/texteditor_p.cpp:610–648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

608}
609
610void TextEditorPrivate::updateCacheInfo(int pos, int added)
611{
612 int line = 0, index = 0;
613 q->lineIndexFromPosition(pos, &line, &index);
614 editor.lineChanged(fileName, line, added);
615 if (lineWidgetContainer->isVisible()) {
616 if (showAtLine > line) {
617 showAtLine += added;
618 showAtLine = qMax(showAtLine, 1);
619
620 updateLineWidgetPosition();
621 }
622 }
623
624 if (inlineCompletionCache.first != -1 && inlineCompletionCache.first >= line) {
625 const auto &eolStr = q->eolAnnotation(inlineCompletionCache.first);
626 if (eolStr.isEmpty() || !inlineCompletionCache.second.contains(eolStr))
627 inlineCompletionCache.first += added;
628 }
629
630 // update eolannotation line
631 for (auto it = eOLAnnotationRecords.begin(); it != eOLAnnotationRecords.end(); ++it) {
632 if (it.value() >= line)
633 it.value() += added;
634 }
635
636 auto iter = markerCache.begin();
637 for (; iter != markerCache.end(); ++iter) {
638 auto &range = iter.value();
639 if (range.endLine < line)
640 continue;
641 else if (range.startLine > line)
642 range.startLine += added;
643
644 range.endLine += added;
645 if (added > 0)
646 q->setRangeBackgroundColor(range.startLine, range.endLine, iter.key());
647 }
648}
649
650void TextEditorPrivate::provideInlineCompletion(int pos, int added)
651{

Callers

nothing calls this directly

Calls 10

lineIndexFromPositionMethod · 0.80
isVisibleMethod · 0.80
eolAnnotationMethod · 0.80
isEmptyMethod · 0.45
containsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
valueMethod · 0.45
keyMethod · 0.45

Tested by

no test coverage detected