On Wed, Apr 06, 2005 at 04:22:18PM +0200, Jean-Marc Lasgouttes wrote:
> >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> 
> Martin> Is this a new feature? Or a regression fix?
> 
> Don't now  :)
> 
> Martin> As you seem to know these things, I'm sure you also know a
> Martin> really code-efficient way to do this :-)
> 
> In math_nestinset.C::doDispatch, I see plenty of code setting cmd to
> LFUN_FINISHED_RIGHT in such cases. I supposed the feature is supposed
> to exist already but does not work anymore. This is probably the
> reason why pageup/down is trapped in math insets (see my other post).
> 
> I am not able to follow the logic, though.
 

You're in good company.

I see this code (I changed the indentation to agree with the logic):

---
                } else 
                       if   (cur.posRight() || idxRight(cur)
                          || cur.popRight() || cur.selection())
                              ;
                       else
                              cmd = FuncRequest(LFUN_FINISHED_RIGHT);
                break;
---

In words: move right within a cell; if I hit the end, skip to the next
cell; if I run out of cells, pop out of this inset; if any of these
succeed (or if selection is on), do nothing further.

When is LFUN_FINISHED_RIGHT ever reached? At end of document?

A second question (am I being just dense or what?): even if the
LFUN_FINISHED_RIGHT statement is reached, what does it actually do? I see
that cmd is redefined, with LFUN_FINISHED_RIGHT as its action, but it's
too late for this dispatch loop. Where is the newly built command being 
dispatched?

This could explain a lot, e.g., why LFUN_END and LFUN_HOME don't manage
to leave the inset even if the cursor is at the end or start. Nothing a
simple cur.popRight or popLeft couldn't fix.

- Martin

Attachment: pgpdSN36mzwZH.pgp
Description: PGP signature

Reply via email to