#include "insets/InsetRef.h"
#include "insets/InsetText.h"
+#include "mathed/MathData.h"
+
#include "frontends/alert.h"
#include "frontends/Application.h"
#include "frontends/Delegates.h"
return Change(Change::UNCHANGED);
DocIterator dit = d->cursor_.selectionBegin();
+ // The selected content might have been changed (see #7685)
+ while (dit.inMathed())
+ // Find enclosing text cursor
+ dit.pop_back();
return dit.paragraph().lookupChange(dit.pos());
}
bool BufferView::selectIfEmpty(DocIterator & cur)
{
- if (!cur.paragraph().empty())
+ if ((cur.inTexted() && !cur.paragraph().empty())
+ || (cur.inMathed() && !cur.cell().empty()))
return false;
pit_type const beg_pit = cur.pit();