Commit 1835567d authored by Michael Reeves's avatar Michael Reeves

Actually use value of firstNonWhite

Tell LineData abount the firstNonWhite index we found.
Drop unused setter while we're at it.
parent 8b9b8ead
Pipeline #9258 passed with stage
in 8 minutes and 49 seconds
......@@ -657,7 +657,7 @@ bool SourceData::FileData::preprocess(QTextCodec* pEncoding)
}
parser->processLine(line);
//kdiff3 internally uses only unix style endings for simplicity.
m_v.push_back(LineData(m_unicodeBuf, lastOffset, line.length(), parser->isPureComment()));
m_v.push_back(LineData(m_unicodeBuf, lastOffset, line.length(), firstNonwhite, parser->isPureComment()));
m_unicodeBuf->append(line).append('\n');
lastOffset = m_unicodeBuf->length();
......
......@@ -98,15 +98,15 @@ class LineData
public:
explicit LineData() = default; // needed for Qt internal reasons should not be used.
inline LineData(const QSharedPointer<QString> &buffer, const qint64 inOffset, QtNumberType inSize = 0, bool inIsPureComment=false)
inline LineData(const QSharedPointer<QString> &buffer, const qint64 inOffset, QtNumberType inSize = 0, QtNumberType inFirstNonWhiteChar=0, bool inIsPureComment=false)
{
mBuffer = buffer;
mOffset = inOffset;
mSize = inSize;
bContainsPureComment = inIsPureComment;
mFirstNonWhiteChar = inFirstNonWhiteChar;
}
Q_REQUIRED_RESULT inline int size() const { return mSize; }
inline void setFirstNonWhiteChar(const qint32 firstNonWhiteChar) { mFirstNonWhiteChar = firstNonWhiteChar;}
Q_REQUIRED_RESULT inline qint32 getFirstNonWhiteChar() const { return mFirstNonWhiteChar; }
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment