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

Method diffText

src/plugins/chat/widgets/inlinechatwidget.cpp:563–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561}
562
563QList<Diff> InlineChatWidgetPrivate::diffText(const QString &str1, const QString &str2)
564{
565 QList<Diff> diffs;
566 try {
567 diff_match_patch dmp;
568 auto a = dmp.diff_linesToChars(str1, str2);
569 auto lineText1 = a[0].toString();
570 auto lineText2 = a[1].toString();
571 auto lineArray = a[2].toStringList();
572 diffs = dmp.diff_main(lineText1, lineText2, false);
573 dmp.diff_charsToLines(diffs, lineArray);
574 } catch (...) {
575 }
576
577 return diffs;
578}
579
580void InlineChatWidgetPrivate::processGeneratedData(const QString &data)
581{

Callers

nothing calls this directly

Calls 4

diff_linesToCharsMethod · 0.80
diff_mainMethod · 0.80
diff_charsToLinesMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected