commit 0031205c12c2c09fda91596830dae06cf6780722
Author: Juergen Spitzmueller <[email protected]>
Date:   Fri Nov 7 14:42:09 2025 +0100

    Fix crash when appending column with cursor in last col
    
    (cherry picked from commit 4cf78b72804c8b28797eda4c2245cc68e193059c)
---
 src/insets/InsetTabular.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index cde368fbaf..fc20b93cca 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -1044,7 +1044,7 @@ void Tabular::insertColumn(col_type col, bool copy, 
row_type row)
        idx_type cspan = columnSpan(cellIndex(row, col));
        col += cspan - 1;
        column_info.insert(column_info.begin() + col + 1,
-                                          ColumnData(column_info[col]));
+                          ColumnData(column_info[col]));
 
        for (row_type r = 0; r < nrows(); ++r) {
                cell_info[r].insert(cell_info[r].begin() + col + 1,
@@ -1052,7 +1052,7 @@ void Tabular::insertColumn(col_type col, bool copy, 
row_type row)
                // make new cell part of multicolumn if old cell was at the 
beginning
                // or middle of a multicolumn
                if (cell_info[r][col].multicolumn == CELL_BEGIN_OF_MULTICOLUMN
-                       || (col + 1 < ncols()
+                       || (col + 2 < ncols()
                                && cell_info[r][col].multicolumn == 
CELL_PART_OF_MULTICOLUMN
                                && cell_info[r][col + 2].multicolumn == 
CELL_PART_OF_MULTICOLUMN
                        ))
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to