On Sat, Apr 09, 2005 at 05:11:01PM +0300, Martin Vermeer wrote:
> On Sat, Apr 09, 2005 at 11:20:09AM +0200, Andre Poenitz wrote:
> > On Thu, Apr 07, 2005 at 07:40:26AM +0300, Martin Vermeer wrote:

...

> > > @@ -564,7 +563,8 @@
> > >                   cur.idx() = cur.lastidx();
> > >                   cur.pos() = cur.lastpos();
> > >           } else {
> > > -                 cmd = FuncRequest(LFUN_FINISHED_RIGHT);
> > > +                 cur.popRight();
> > > +                 cur.pos() = cur.lastpos();
> > >           }
> > >           break;
> > >  
> > 
> > This is the wrong approach as it makes an assumption on how the parent
> > would handle the request (set pos to last pos). Even if this might work
> > in particular case no inset should make such an assumption.
> > 
> > LFUN_FINISHED_RIGHT says 'leave this inset but let my parent handle the
> > details'.
> 
> OK. What details in this case? I.e., is the LFUN executed by the parent
> (i.e., in my test case another nestinset as found by the cursor on the stack)
> LFUN_FINISHED_RIGHT, or the original LFUN_END? It seems the former.
> 
> - Martin
> 
>  
> > Andre'

Here is the next patch... adding a cur.undispatched() statement did the job. 
So the LFUN_FINISHED mechanism seems to work... in this case, it allowed
he cursor to skip out of the inset, immediately to the right of the 
parentesis, when pressing the END key. But how now do I get it to go
forward to the next parentesis, i.e., execute LFUN_END for the parent
inset? (Yes, I know, pressing the END key again. Not what I wanted to hear :)

- Martin
Index: math_nestinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_nestinset.C,v
retrieving revision 1.150
diff -u -r1.150 math_nestinset.C
--- math_nestinset.C    8 Apr 2005 12:15:28 -0000       1.150
+++ math_nestinset.C    9 Apr 2005 14:26:10 -0000
@@ -555,6 +555,7 @@
                        cur.pos() = 0;
                } else {
                        cmd = FuncRequest(LFUN_FINISHED_LEFT);
+                       cur.undispatched();
                }
                break;
 
@@ -575,6 +576,7 @@
                        cur.pos() = cur.lastpos();
                } else {
                        cmd = FuncRequest(LFUN_FINISHED_RIGHT);
+                       cur.undispatched();
                }
                break;
 

Attachment: pgpTXgmJ7oTn5.pgp
Description: PGP signature

Reply via email to