| 608 | } |
| 609 | |
| 610 | void 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 | |
| 650 | void TextEditorPrivate::provideInlineCompletion(int pos, int added) |
| 651 | { |
nothing calls this directly
no test coverage detected