[EMAIL PROTECTED] (Jürgen Spitzmüller) writes:

> Jean-Marc Lasgouttes wrote:
>> OK then. But I still think that moving the code to Text is better
>> (since the code only works in text).
>
> So you think the lfun should be disabled if the cursor is in mathed, even if 
> the formula is part of a section?

No, if the lfun is only handled in Text what happens is that

- Cursor::dispatch asks the top slice (mathed) whether it knows about
  outline ==> no

- Cursor::dispatch asks the next slice (text) whether it knows about
  outline ==> yes!

- the outline stuff is done at text level

The current situation is

- Cursor::dispatch asks all the slices whether they know about
  outline ==> no

- LyXunc::dispatch tries BufferView::dispatch ==> yes, but it crashes
  if the cursor is in math

The idea is that the lfun should be handled in the place that is the
most reasonable:

- LyXFunc::dispatch: all things that are not related to a particular
  buffer

- BufferView::dispatch: all things that are global on a buffer or are
  able to handle transparently math or text

- Text::dispatch: operations that only make sense in a text inset

- InsetFoo::doDispatch: operations that only make sense in a given
  inset

- InsetMathNest::dispatch: operations that only make sense in mathed.

There should be a Buffer::dispatch for operations that work on a
buffer but do not require a view, but it does not exist (actually
there is one but it does not do what I would expect).

JMarc

Reply via email to