]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
Cmake build: Creating a define for a header file found
[lyx.git] / src / BufferView.cpp
index 4aa3360017e96c507328d3f066222132eade5feb..43420209cceab24a9d4101b4855c72ad797a437e 100644 (file)
@@ -1809,7 +1809,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        cur.forwardInset();
                cur.beginUndoGroup();
                while(cur && iterations < max_iter) {
-                       Inset * ins = cur.nextInset();
+                       Inset * const ins = cur.nextInset();
                        if (!ins)
                                break;
                        docstring insname = ins->layoutName();
@@ -1825,7 +1825,9 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                                        break;
                                insname = insname.substr(0, i);
                        }
-                       cur.forwardInset();
+                       // if we did not delete the inset, skip it
+                       if (!cur.nextInset() || cur.nextInset() == ins)
+                               cur.forwardInset();
                }
                cur.endUndoGroup();
                cur = savecur;