TextEditor: Sort indent ranges before applying

It can easily happen that callers insert indent ranges out of order, and
without sorting the indentation done earlier in the file is not
considered for the later parts, leading to inconsistent results.

Fixes: QTCREATORBUG-18929
Change-Id: Ice2abe92d54446bcdd102c6a1f822262a8533543
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2020-06-12 13:41:00 +02:00
parent 9be4a5f839
commit 934641f45c
3 changed files with 44 additions and 1 deletions

View File

@@ -121,4 +121,9 @@ private:
bool m_error;
};
inline bool operator<(const ChangeSet::Range &r1, const ChangeSet::Range &r2)
{
return r1.start < r2.start;
}
} // namespace Utils