diff --git a/src/cursor.C b/src/cursor.C index 3c472d3a06..e6c8973008 100644 --- a/src/cursor.C +++ b/src/cursor.C @@ -120,8 +120,11 @@ void LCursor::push(InsetOld * inset, LyXText * text) void LCursor::pop() { - BOOST_ASSERT(!data_.empty()); - data_.pop_back(); + //BOOST_ASSERT(!data_.empty()); + if (data_.empty()) + lyxerr << "### TRYING TO POP FROM EMPTY CURSOR" << endl; + else + data_.pop_back(); } diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 4963779a62..e90fcb85ae 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -17,6 +17,7 @@ #include "bufferparams.h" #include "BufferView.h" #include "CutAndPaste.h" +#include "cursor.h" #include "debug.h" #include "dispatchresult.h" #include "errorlist.h" @@ -719,6 +720,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd, if (result.val() >= FINISHED) { updateLocal(bv, false); bv->unlockInset(this); + bv->cursor().pop(); } break; case FINISHED_DOWN: @@ -726,6 +728,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd, if (result.val() >= FINISHED) { updateLocal(bv, false); bv->unlockInset(this); + bv->cursor().pop(); } break; default: @@ -951,6 +954,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd, if (result.val() >= FINISHED) { result.val(NONE); bv->unlockInset(this); + bv->cursor().pop(); } return result;