]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
Fix a crash when closing tabs
[lyx.git] / src / Cursor.cpp
index 074047f4901f634a21ff0ff70d9b25787ac17883..fae9d85c3f3c98bf743fc89592aa3e52b8fdf1eb 100644 (file)
@@ -1594,9 +1594,20 @@ bool Cursor::backspace(bool const force)
                        // [|], can not delete from inside
                        return false;
                } else {
-                       if (inMathed())
-                               pullArg();
-                       else
+                       if (inMathed()) {
+                               switch (inset().asInsetMath()->getType()) {
+                               case hullEqnArray:
+                               case hullAlign:
+                               case hullFlAlign: {
+                                       FuncRequest cmd(LFUN_CHAR_BACKWARD);
+                                       this->dispatch(cmd);
+                                       break;
+                               }
+                               default:
+                                       pullArg();
+                                       break;
+                               }
+                       } else
                                popBackward();
                        return true;
                }