Angus Leeming wrote:

> Nonetheless, I'll commit and we can proceed from there.

What about the following?

Alfredo
Index: lyxfunc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.594
diff -u -p -u -r1.594 lyxfunc.C
--- lyxfunc.C	30 Mar 2004 16:19:49 -0000	1.594
+++ lyxfunc.C	30 Mar 2004 17:48:40 -0000
@@ -551,6 +551,7 @@ bool ensureBufferClean(BufferView * bv)
 	return buf.isClean();
 }
 
+
 void showPrintError(string const & name)
 {
 		string str = bformat(_("Could not print the document %1$s.\n"
@@ -559,6 +560,18 @@ void showPrintError(string const & name)
 		Alert::error(_("Print document failed"), str);
 }
 
+
+void getOutOf(LCursor & cur, InsetBase const & in)
+{
+	for (unsigned int i = 0; i != cur.size(); ++i) {
+		if (&cur[i].inset() == &in) {
+			cur.resize(i);
+			return;
+		}
+	}
+}
+
+
 } //namespace anon
 
 
@@ -1274,9 +1287,8 @@ void LyXFunc::dispatch(FuncRequest const
 				if (inset_code == InsetBase::NO_CODE
 				    || inset_code == it->lyxCode()) {
 					it->dispatch(cur, fr);
-					if (&cur.inset() == &*it
-					    && cur.disp_.dispatched())
-						cur.pop();
+					if (cur.disp_.dispatched())
+						getOutOf(cur, *it);
 				}
 			}
 			break;

Reply via email to