From 2a6f2e4f98e467b40d1ec40602d3d7e6dca66cea Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 27 Jun 2026 00:27:32 +0400 Subject: [PATCH] Show Unite cells in the top-control table menu --- .../SourceFiles/iv/editor/iv_editor_widget.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Telegram/SourceFiles/iv/editor/iv_editor_widget.cpp b/Telegram/SourceFiles/iv/editor/iv_editor_widget.cpp index 36fac64a34..459262a210 100644 --- a/Telegram/SourceFiles/iv/editor/iv_editor_widget.cpp +++ b/Telegram/SourceFiles/iv/editor/iv_editor_widget.cpp @@ -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;