Juergen Spitzmueller wrote:
> > Do you see what I mean?
>
> Not quite.

Now I do.
The attached patch also closes a float when the cursor is in a nested tabular.

Jürgen 
Index: text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.313
diff -p -u -r1.313 text3.C
--- text3.C	13 Oct 2005 14:48:27 -0000	1.313
+++ text3.C	18 Oct 2005 06:46:36 -0000
@@ -754,12 +754,19 @@ void LyXText::dispatch(LCursor & cur, Fu
 		break;
 
 	case LFUN_NEXT_INSET_TOGGLE: {
+		FuncRequest fr = cmd;
+		fr.action = LFUN_INSET_TOGGLE;
 		InsetBase * inset = cur.nextInset();
 		if (inset) {
-			cur.clearSelection();
-			FuncRequest fr = cmd;
-			fr.action = LFUN_INSET_TOGGLE;
+			cur.clearSelection();	
 			inset->dispatch(cur, fr);
+		} else {
+			inset = &cur.inset();
+			if (inset) {
+				inset->dispatch(cur, fr);
+				if (inset = cur.nextInset())
+					cur.posRight();
+			}
 		}
 		break;
 	}
Index: insets/insettabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v
retrieving revision 1.489
diff -p -u -r1.489 insettabular.C
--- insets/insettabular.C	19 Sep 2005 14:38:13 -0000	1.489
+++ insets/insettabular.C	18 Oct 2005 06:46:42 -0000
@@ -744,6 +744,16 @@ void InsetTabular::doDispatch(LCursor & 
 		cell(cur.idx())->dispatch(cur, cmd);
 		break;
 
+	case LFUN_INSET_TOGGLE: {
+		InsetBase * inset = &cur.inset();
+		// we might be in a collapsable in front of the table
+		if (inset && inset != this)
+			inset->dispatch(cur, cmd);
+		else
+			cur.undispatched();
+		break;
+	}
+
 	case LFUN_EMPH:
 	case LFUN_BOLD:
 	case LFUN_ROMAN:

Reply via email to