aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlformat/commentastvisitor.h
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2020-09-04 11:22:12 +0200
committerMaximilian Goldstein <max.goldstein@qt.io>2020-09-04 12:33:24 +0200
commit5d9b0d30df831649ceed58fee778bb37ac6f630e (patch)
tree0865b0f5b604989df379b93b98bc1f60d728e453 /tools/qmlformat/commentastvisitor.h
parent18b13c9126a3cbc32c616621802165591a5e2f5f (diff)
qmlformat: Fix multiline comment attachment
Pick-to: 5.15 Change-Id: I3ba8a4cd683df3309dd6df31b1fd426a0875f8fa Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmlformat/commentastvisitor.h')
-rw-r--r--tools/qmlformat/commentastvisitor.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/qmlformat/commentastvisitor.h b/tools/qmlformat/commentastvisitor.h
index 21c7eb6416..6ebf8246ba 100644
--- a/tools/qmlformat/commentastvisitor.h
+++ b/tools/qmlformat/commentastvisitor.h
@@ -78,6 +78,14 @@ struct Comment
return false;
}
+ quint32 endLine() const
+ {
+ if (isSyntheticMultiline() || !isValid())
+ return 0;
+
+ return m_srcLocations[0].startLine + m_text.count(QLatin1Char('\n'));
+ }
+
QString m_text;
};