]> git.lyx.org Git - features.git/commitdiff
When pasting several cells in mathed, take cursor position in account
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 14 Jul 2019 23:17:28 +0000 (01:17 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 14 Jul 2019 23:20:08 +0000 (01:20 +0200)
Related to bug #11390

src/mathed/InsetMathGrid.cpp

index 9ba2dda197e45fdf3fffdd06c441f2aa8fe6d973..fe823d42e46e2c6bab9431d2739d5e3f224002a8 100644 (file)
@@ -1629,7 +1629,8 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
                        for (row_type r = 0; r < numrows; ++r) {
                                for (col_type c = 0; c < numcols; ++c) {
                                        idx_type i = index(r + cur.row(), c + col(cur.idx()));
-                                       cell(i).insert(0, grid.cell(grid.index(r, c)));
+                                       cell(i).insert(c == 0 ? cur.pos() : 0,
+                                                      grid.cell(grid.index(r, c)));
                                }
                                if (hline_enabled)
                                        rowinfo_[r].lines += grid.rowinfo_[r].lines;