The problem is that, for an unknown reason, an InsetMathHull is used *inside* an InsetMathHull. This is the reason why we have two levels of instant preview. I don't know if that was intended.
When moving the cursor, only the doDispatch() of the enclosing InsetMathHull is
called, not the inner one; so we don't have a chance to detect that the inner InsetMathHull should leave its preview mode.
The new leavePreview() method ensures that the screen will be redrawn if needed with cursor movement.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27186
a592a061-630c-0410-9148-
cb99ea01b6c8
}
+void InsetMathHull::leavePreview(Cursor & cur) const
+{
+ if (!use_preview_)
+ return;
+ use_preview_ = false;
+ Update::flags flags = cur.result().update();
+ if (flags & Update::FitCursor)
+ cur.updateFlags(flags | Update::Force);
+}
+
+
bool InsetMathHull::idxFirst(Cursor & cur) const
{
cur.idx() = 0;
cur.pos() = 0;
+ leavePreview(cur);
return true;
}
{
cur.idx() = nargs() - 1;
cur.pos() = cur.lastpos();
+ leavePreview(cur);
return true;
}
void handleFont2(Cursor & cur, docstring const & arg);
///
bool previewState(BufferView * bv) const;
+ ///
+ void leavePreview(Cursor & cur) const;
};