[utilities/kate] addons/git-blame: Don't wrap file paths section in git blame tooltip
Christoph Cullmann <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 0c41960cc0ae9b1fb67174cfe43e809e59f874e6 by Christoph Cullmann, on behalf of Leo Ruggeri.
Committed on 25/07/2026 at 11:45.
Pushed by cullmann into branch 'master'.
Don't wrap file paths section in git blame tooltip
M +7 -3 addons/git-blame/gitblametooltip.cpp
https://invent.kde.org/utilities/kate/-/commit/0c41960cc0ae9b1fb67174cfe43e809e59f874e6
diff --git a/addons/git-blame/gitblametooltip.cpp b/addons/git-blame/gitblametooltip.cpp
index dafce0ec43..948d3b90b5 100644
--- a/addons/git-blame/gitblametooltip.cpp
+++ b/addons/git-blame/gitblametooltip.cpp
@@ -69,8 +69,10 @@ public:
bool inDiff = false;
- QString preTagOpen = QStringLiteral("<pre style='margin: 3; white-space: pre-wrap;'>");
- QString preTagClose = QStringLiteral("</pre>");
+ int hrCount = 0;
+ const QString preTagOpen = QStringLiteral("<pre style='margin: 3; white-space: pre-wrap;'>");
+ const QString preTagOpenNoWrap = QStringLiteral("<pre style='margin: 3; white-space: pre;'>");
+ const QString preTagClose = QStringLiteral("</pre>");
KSyntaxHighlighting::State state;
out << preTagOpen;
@@ -90,7 +92,9 @@ public:
// allow empty lines in code blocks, no ruler here
if (!inDiff && currentLine.isEmpty()) {
- out << preTagClose << "<hr>" << preTagOpen;
+ // Don't wrap file paths: we assume file paths section starts after second hr
+ out << preTagClose << "<hr>" << (hrCount < 1 ? preTagOpen : preTagOpenNoWrap);
+ hrCount++;
continue;
}