Does the following patch look reasonable? The boundary of each slice is kind of implicitly false for all slices but the top slice of a cursor. So when popping slices we should set the boundary flag to false.

This fixes the following crash:
* ctrl-m a
* right (leaving the math to the right)
* left (entering from the right)
* right (leaving math to the right)
* => crash

The problem is that after the "a" the cursor's boundary is false. After the "left" the inset is entered from the right by setting the pos to lastpos with boundary to true (@I guess this is the way it should be. Dov?). Then when leaving the boundary is kept in the cursor dispatch loop which is wrong. Eventually there is a bidi lookup which crashes as a consequence of all this.

Stefan


diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index de64c50..9b97044 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -300,7 +300,7 @@ void Cursor::dispatch(FuncRequest const & cmd0)

        // store some values to be used inside of the handlers
        beforeDispatchCursor_ = *this;
-       for (; depth(); pop()) {
+       for (; depth(); pop(), boundary(false)) {
                LYXERR(Debug::DEBUG, "Cursor::dispatch: cmd: "
                        << cmd0 << endl << *this);
                BOOST_ASSERT(pos() <= lastpos());

Reply via email to