Stefan Schimanski wrote:
Right, too late for 1.5. Still the inverse logic is better IMHO.
So it marks the lfun as undispatched. But then the Update::Force
flag is overwritten later by the cursor down handler of the text.
Maybe you could change this overwritting?
As far
as I see there is no way to trigger a complete redraw reliable from
anywhere else than the inset which dispatches the lfun.
If the Cursor is passed there is: by checking and accumulating the
update flag.
What do you mean? I don't see how to do anything like that.
I mean: if (cur.result().update() == Update::Force) this means that
the flag has been explicitely set previously as opposed to have the
default value (Update::FitCursor | Update::Force). Maybe this
information could be used?
Here is a solution in the direction I described: the old cursor is
stored before dispatch and then used after moving up/down to tell the
insets that the cursor left them.
This looks good. Instead of storing the old cursor you could have reset
the cursor at the beginning of InsetMathNest::dispatch() as I have done
in Text::dispatch():
// FIXME: We use the update flag to indicates wether a singlePar or a
// full screen update is needed. We reset it here but shall we restore
// it at the end?
cur.noUpdate();
But I think I like your solution better. With your patch, as we now sort
of ignore the initial setting of the update flag maybe we should change
this as well?
Index: src/mathed/InsetMathNest.cpp
===================================================================
+ // FIXME: what is this doing?
+ bool select = cmd.action == LFUN_DOWN_SELECT ||
+ cmd.action == LFUN_UP_SELECT;
+ cur.selHandle(select);
It sets the selection. Otherwise how would you notify that what's in
between the current cursor position and the soon to be moved cursor is
going to be selected?
I guess you could as well do something like this:
case LFUN_DOWN_SELECT:
case LFUN_UP_SELECT:
cur.updateFlags(Update::Force | Update::FitCursor);
cur.selHandle(select);
case LFUN_DOWN:
case LFUN_UP:
cur.updateFlags(cur.result().update()
| Update::Decoration | Update::FitCursor);
// go up/down
...
break;
Abdel.