Show Unite cells in the top-control table menu

This commit is contained in:
John Preston
2026-06-27 00:27:32 +04:00
parent 923f36ecac
commit 2a6f2e4f98
@@ -4950,6 +4950,22 @@ Widget::currentTableRangeAtCaret() const {
if (range.empty() || !_state->tableSelectionInfo(range).valid) {
return std::nullopt;
}
const auto source = Markdown::PreparedEditTableCellSource{
.block = activeLeaf->block,
.tableRowIndex = cell.rowFrom,
.tableCellIndex = cell.cellIndex,
.column = cell.columnFrom,
.colspan = cell.columnTill - cell.columnFrom,
.rowspan = cell.rowTill - cell.rowFrom,
};
if (const auto selected = _state->tableContextRangeForSelection(
_structuralSelection,
source)) {
if (!selected->empty()
&& _state->tableSelectionInfo(*selected).valid) {
return *selected;
}
}
return range;
}
return std::nullopt;