// FIXME: the following code should go in favor of fine grained
// update flag treatment.
- if (singleParUpdate) {
+ if (singleParUpdate || cur.result().screenUpdate() & Update::SinglePar) {
// Inserting characters does not change par height in general. So, try
// to update _only_ this paragraph. BufferView will detect if a full
// metrics update is needed anyway.
{
if (RenderPreview::previewMath()) {
reloadPreview(old);
- cur.screenUpdateFlags(Update::Force);
+ cur.screenUpdateFlags(Update::SinglePar);
}
return false;
}
void InsetMathHull::edit(Cursor & cur, bool front, EntryDirection entry_from)
{
+ bool const has_preview = previewState(&cur.bv());
cur.push(*this);
bool enter_front = (entry_from == Inset::ENTRY_DIRECTION_LEFT ||
(entry_from == Inset::ENTRY_DIRECTION_IGNORE && front));
enter_front ? idxFirst(cur) : idxLast(cur);
- // The inset formula dimension is not necessarily the same as the
- // one of the instant preview image, so we have to indicate to the
- // BufferView that a metrics update is needed.
- cur.screenUpdateFlags(Update::Force);
+ if (has_preview) {
+ // The inset formula dimension is in general different from the
+ // one of the instant preview image, so we have to indicate to the
+ // BufferView that a metrics update is needed.
+ cur.screenUpdateFlags(Update::SinglePar);
+ }
}