mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
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
This commit is contained in:
parent
46b4a8428b
commit
8939303131
@ -277,10 +277,22 @@ InsetMath::mode_type InsetMathHull::currentMode() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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
|
bool InsetMathHull::idxFirst(Cursor & cur) const
|
||||||
{
|
{
|
||||||
cur.idx() = 0;
|
cur.idx() = 0;
|
||||||
cur.pos() = 0;
|
cur.pos() = 0;
|
||||||
|
leavePreview(cur);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,6 +301,7 @@ bool InsetMathHull::idxLast(Cursor & cur) const
|
|||||||
{
|
{
|
||||||
cur.idx() = nargs() - 1;
|
cur.idx() = nargs() - 1;
|
||||||
cur.pos() = cur.lastpos();
|
cur.pos() = cur.lastpos();
|
||||||
|
leavePreview(cur);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,6 +231,8 @@ protected:
|
|||||||
void handleFont2(Cursor & cur, docstring const & arg);
|
void handleFont2(Cursor & cur, docstring const & arg);
|
||||||
///
|
///
|
||||||
bool previewState(BufferView * bv) const;
|
bool previewState(BufferView * bv) const;
|
||||||
|
///
|
||||||
|
void leavePreview(Cursor & cur) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user