MCPcopy Create free account
hub / github.com/KDE/kdevelop / subDiffHunk

Method subDiffHunk

kdevplatform/vcs/vcsdiff.cpp:385–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383};
384
385KDevelop::VcsDiff VcsDiff::subDiffHunk(const uint line, DiffDirection dir) const
386{
387 auto hunks = d->hunks;
388 for (const auto& hunk : hunks) {
389 if (hunk.containsDiffLine(line)) {
390 return subDiff(hunk.headingLineIdx, hunk.lastLineIdx(), dir);
391 }
392 }
393
394 VcsDiff emptyDiff;
395 emptyDiff.setBaseDiff(d->baseDiff);
396 emptyDiff.setDepth(d->depth);
397 emptyDiff.setDiff(d->diff.mid(0,d->diff.indexOf(QStringLiteral("@@"))));
398 return emptyDiff;
399}
400
401KDevelop::VcsDiff VcsDiff::subDiff(const uint startLine, const uint endLine, DiffDirection dir) const
402{

Callers 2

testSubDiffMethod · 0.80
applySelectedMethod · 0.80

Calls 7

containsDiffLineMethod · 0.80
lastLineIdxMethod · 0.80
setBaseDiffMethod · 0.80
setDepthMethod · 0.80
midMethod · 0.80
setDiffMethod · 0.45
indexOfMethod · 0.45

Tested by 1

testSubDiffMethod · 0.64