Skip to content
Snippets Groups Projects
Commit cb296f49 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

qmljsrewriter: fix rewriting issue

We have to keep the line ending in case the removed
property is not the only thning in that line
parent 0761e890
No related branches found
No related tags found
No related merge requests found
......@@ -419,8 +419,6 @@ bool Rewriter::includeSurroundingWhitespace(int &start, int &end) const
while (c.isSpace()) {
++end;
if (c.unicode() == 10) {
paragraphFound = true;
break;
......@@ -434,18 +432,23 @@ bool Rewriter::includeSurroundingWhitespace(int &start, int &end) const
includeStartingWhitespace = paragraphFound;
}
paragraphFound = false;
if (includeStartingWhitespace) {
while (start > 0) {
const QChar c = m_originalText.at(start - 1);
if (!c.isSpace())
if (c.unicode() == 10) {
paragraphFound = true;
break;
else if (c.unicode() == 10)
}
if (!c.isSpace())
break;
--start;
}
}
if (!paragraphFound) //keep the line ending
--end;
return paragraphFound;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment