Git/DiffEditor: Fix staging added/removed lines separately

Fixes: QTCREATORBUG-23243
Change-Id: Ice19e1c778aabd9cb1b9fe0681234073de85cfcb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2019-11-20 16:01:17 +01:00
parent 27d503558f
commit 3b9ce98865
7 changed files with 213 additions and 80 deletions

View File

@@ -102,10 +102,12 @@ public:
class DIFFEDITOR_EXPORT ChunkSelection {
public:
ChunkSelection() {}
ChunkSelection(int s, int c) : startRow(s), selectedRowsCount(c) {}
bool isNull() const { return selectedRowsCount <= 0; }
int startRow = -1;
int selectedRowsCount = 0;
ChunkSelection(const QList<int> &left, const QList<int> &right)
: leftSelection(left), rightSelection(right) {}
bool isNull() const { return leftSelection.isEmpty() && rightSelection.isEmpty(); }
int selectedRowsCount() const;
QList<int> leftSelection;
QList<int> rightSelection;
};
class DIFFEDITOR_EXPORT FileData {