bool const ct = force ? false : buffer().params().track_changes;
for (col_type c = 0; c < ncols(); ++c) {
- // mark track changes
- if (ct)
- cell_info[row][c].inset->setChange(Change(Change::DELETED));
// Care about multirow cells
if (row + 1 < nrows() &&
cell_info[row][c].multirow == CELL_BEGIN_OF_MULTIROW &&
for (col_type c = 0; c < ncols(); ++c) {
cell_info[row + 1].insert(cell_info[row + 1].begin() + c,
copy ? CellData(cell_info[row][c]) : CellData(buffer_));
- if (buffer().params().track_changes)
- cell_info[row + 1][c].inset->setChange(Change(Change::INSERTED));
if (cell_info[row][c].multirow == CELL_BEGIN_OF_MULTIROW)
cell_info[row + 1][c].multirow = CELL_PART_OF_MULTIROW;
}
setBottomLine(i, true);
setBottomLine(j, false);
}
- // mark track changes
- if (buffer().params().track_changes)
- cellInfo(i).inset->setChange(Change(Change::INSERTED));
}
- if (buffer().params().track_changes)
+ if (buffer().params().track_changes) {
row_info[row + 1].change.setInserted();
+ updateIndexes();
+ }
}
bool const ct = force ? false : buffer().params().track_changes;
for (row_type r = 0; r < nrows(); ++r) {
- // mark track changes
- if (ct)
- cell_info[r][col].inset->setChange(Change(Change::DELETED));
// Care about multicolumn cells
if (col + 1 < ncols() &&
cell_info[r][col].multicolumn == CELL_BEGIN_OF_MULTICOLUMN &&
for (row_type r = 0; r < nrows(); ++r) {
cell_info[r].insert(cell_info[r].begin() + col + 1,
copy ? CellData(cell_info[r][col]) : CellData(buffer_));
- if (ct)
- cell_info[r][col + 1].inset->setChange(Change(Change::INSERTED));
if (cell_info[r][col].multicolumn == CELL_BEGIN_OF_MULTICOLUMN)
cell_info[r][col + 1].multicolumn = CELL_PART_OF_MULTICOLUMN;
}
if (rightLine(i) && rightLine(j)) {
setRightLine(j, false);
}
- if (ct)
- cellInfo(i).inset->setChange(Change(Change::INSERTED));
}
- if (ct)
+ if (ct) {
column_info[col + 1].change.setInserted();
+ updateIndexes();
+ }
}
rowofcell.resize(numberofcells);
columnofcell.resize(numberofcells);
idx_type i = 0;
- // reset column and row of cells and update their width and alignment
- for (row_type row = 0; row < nrows(); ++row)
+ // reset column and row of cells and update their width, alignment and ct status
+ for (row_type row = 0; row < nrows(); ++row) {
for (col_type column = 0; column < ncols(); ++column) {
if (isPartOfMultiColumn(row, column)) {
cell_info[row][column].inset->toggleMultiCol(true);
cell_info[row][column].inset->toggleMultiRow(false);
cell_info[row][column].inset->setContentAlignment(
getAlignment(cellIndex(row, column)));
+ if (buffer().params().track_changes) {
+ if (row_info[row].change.changed())
+ cell_info[row][column].inset->setChange(row_info[row].change);
+ if (column_info[column].change.changed())
+ cell_info[row][column].inset->setChange(column_info[column].change);
+ }
++i;
}
+ }
}
}
}
if (ct) {
+ tabular.updateIndexes();
// cursor might be invalid
cur.fixIfBroken();
+ // change bar might need to be redrawn
+ cur.screenUpdateFlags(Update::Force);
+ cur.forceBufferUpdate();
}
break;
} else {
else if (tabular.column_info[col].change.deleted())
tabular.deleteColumn(col, true);
}
+ tabular.updateIndexes();
}
else if (tabular.column_info[col].change.inserted())
tabular.deleteColumn(col, true);
}
+ tabular.updateIndexes();
}